diff options
Diffstat (limited to 'packages/trpc')
| -rw-r--r-- | packages/trpc/routers/bookmarks.ts | 1 | ||||
| -rw-r--r-- | packages/trpc/types/bookmarks.ts | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index 65037f6b..a447235b 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -231,6 +231,7 @@ export const bookmarksAppRouter = router({ const res = await ctx.db .update(bookmarks) .set({ + title: input.title, archived: input.archived, favourited: input.favourited, note: input.note, diff --git a/packages/trpc/types/bookmarks.ts b/packages/trpc/types/bookmarks.ts index cf9c2ddf..2cf8152b 100644 --- a/packages/trpc/types/bookmarks.ts +++ b/packages/trpc/types/bookmarks.ts @@ -2,6 +2,8 @@ import { z } from "zod"; import { zBookmarkTagSchema } from "./tags"; +const MAX_TITLE_LENGTH = 100; + export const zBookmarkedLinkSchema = z.object({ type: z.literal("link"), url: z.string().url(), @@ -39,6 +41,7 @@ export type ZBookmarkContent = z.infer<typeof zBookmarkContentSchema>; export const zBareBookmarkSchema = z.object({ id: z.string(), createdAt: z.date(), + title: z.string().max(MAX_TITLE_LENGTH).nullish(), archived: z.boolean(), favourited: z.boolean(), taggingStatus: z.enum(["success", "failure", "pending"]).nullable(), @@ -108,6 +111,7 @@ export const zUpdateBookmarksRequestSchema = z.object({ archived: z.boolean().optional(), favourited: z.boolean().optional(), note: z.string().optional(), + title: z.string().max(MAX_TITLE_LENGTH).nullish(), }); export type ZUpdateBookmarksRequest = z.infer< typeof zUpdateBookmarksRequestSchema |
