Skip to content

Commit 1a507da

Browse files
committed
Fix validation check which was causing contest creation to fail
1 parent 940b028 commit 1a507da

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lib/validations.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ export const EmailSchema = z.string().email().openapi({
2121
description: "Valid email address",
2222
});
2323

24-
export const TimestampSchema = z.string().datetime().openapi({
25-
example: "2024-03-20T10:00:00Z",
26-
description: "ISO 8601 datetime string",
27-
});
24+
export const TimestampSchema = z
25+
.string()
26+
.datetime()
27+
.transform((str) => new Date(str))
28+
.openapi({
29+
example: "2024-03-20T10:00:00Z",
30+
description: "ISO 8601 datetime string",
31+
});
2832

2933
// User Schemas
3034
export const createUserSchema = z

0 commit comments

Comments
 (0)