aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/lib
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-02-23 19:27:31 +0000
committerMohamedBassem <me@mbassem.com>2024-02-23 20:47:54 +0000
commite234d3535c363664902dffe89a2c61ddbc037da4 (patch)
tree5430570d98bc376ce92c8ecc5d2503ecced1d79b /packages/web/lib
parentbed57209b09a4bd59dbaf010d58045fe77896ba8 (diff)
downloadkarakeep-e234d3535c363664902dffe89a2c61ddbc037da4.tar.zst
db: Migrate from prisma to drizzle
Diffstat (limited to 'packages/web/lib')
-rw-r--r--packages/web/lib/types/api/bookmarks.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/web/lib/types/api/bookmarks.ts b/packages/web/lib/types/api/bookmarks.ts
index 94f89e55..0970a7ed 100644
--- a/packages/web/lib/types/api/bookmarks.ts
+++ b/packages/web/lib/types/api/bookmarks.ts
@@ -17,14 +17,19 @@ export const zBookmarkContentSchema = z.discriminatedUnion("type", [
]);
export type ZBookmarkContent = z.infer<typeof zBookmarkContentSchema>;
-export const zBookmarkSchema = z.object({
+export const zBareBookmarkSchema = z.object({
id: z.string(),
createdAt: z.date(),
archived: z.boolean(),
favourited: z.boolean(),
- tags: z.array(zBookmarkTagSchema),
- content: zBookmarkContentSchema,
});
+
+export const zBookmarkSchema = zBareBookmarkSchema.merge(
+ z.object({
+ tags: z.array(zBookmarkTagSchema),
+ content: zBookmarkContentSchema,
+ }),
+);
export type ZBookmark = z.infer<typeof zBookmarkSchema>;
// POST /v1/bookmarks