From e89a38680532c3ab72ef26dfe88bb64476b709ab Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 20 Oct 2024 15:54:34 +0000 Subject: feature(api): Add REST APIs to update bookmarks, tags and lists --- packages/trpc/routers/tags.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'packages/trpc/routers') diff --git a/packages/trpc/routers/tags.ts b/packages/trpc/routers/tags.ts index a5d93213..c04593c9 100644 --- a/packages/trpc/routers/tags.ts +++ b/packages/trpc/routers/tags.ts @@ -6,7 +6,10 @@ import type { ZAttachedByEnum } from "@hoarder/shared/types/tags"; import { SqliteError } from "@hoarder/db"; import { bookmarkTags, tagsOnBookmarks } from "@hoarder/db/schema"; import { triggerSearchReindex } from "@hoarder/shared/queues"; -import { zGetTagResponseSchema } from "@hoarder/shared/types/tags"; +import { + zGetTagResponseSchema, + zUpdateTagRequestSchema, +} from "@hoarder/shared/types/tags"; import type { Context } from "../index"; import { authedProcedure, router } from "../index"; @@ -150,12 +153,7 @@ export const tagsAppRouter = router({ return { deletedTags: res.changes }; }), update: authedProcedure - .input( - z.object({ - tagId: z.string(), - name: z.string().optional(), - }), - ) + .input(zUpdateTagRequestSchema) .output( z.object({ id: z.string(), -- cgit v1.2.3-70-g09d2