diff options
| -rw-r--r-- | packages/open-api/hoarder-openapi-spec.json | 6 | ||||
| -rw-r--r-- | packages/shared/types/bookmarks.ts | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/packages/open-api/hoarder-openapi-spec.json b/packages/open-api/hoarder-openapi-spec.json index fcd0fb77..4cfbfe63 100644 --- a/packages/open-api/hoarder-openapi-spec.json +++ b/packages/open-api/hoarder-openapi-spec.json @@ -555,7 +555,8 @@ "type": "string" }, "createdAt": { - "type": "string" + "type": "string", + "nullable": true } } }, @@ -748,7 +749,8 @@ "maxLength": 250 }, "createdAt": { - "type": "string" + "type": "string", + "nullable": true } } } diff --git a/packages/shared/types/bookmarks.ts b/packages/shared/types/bookmarks.ts index 41f689cd..8ee523a6 100644 --- a/packages/shared/types/bookmarks.ts +++ b/packages/shared/types/bookmarks.ts @@ -122,7 +122,7 @@ export const zNewBookmarkRequestSchema = z favourited: z.boolean().optional(), note: z.string().optional(), summary: z.string().optional(), - createdAt: z.date().optional(), + createdAt: z.coerce.date().optional(), }) .and( z.discriminatedUnion("type", [ @@ -178,7 +178,7 @@ export const zUpdateBookmarksRequestSchema = z.object({ summary: z.string().nullish(), note: z.string().optional(), title: z.string().max(MAX_TITLE_LENGTH).nullish(), - createdAt: z.date().optional(), + createdAt: z.coerce.date().optional(), }); export type ZUpdateBookmarksRequest = z.infer< typeof zUpdateBookmarksRequestSchema |
