From 10dcf2e7429601fcbde42e3d10c46c074dc9a28a Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 20 Oct 2024 14:58:16 +0000 Subject: feature: Add APIs to create new lists and bookmarks --- packages/trpc/routers/lists.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'packages/trpc/routers/lists.ts') diff --git a/packages/trpc/routers/lists.ts b/packages/trpc/routers/lists.ts index a69d1f24..0cc937b1 100644 --- a/packages/trpc/routers/lists.ts +++ b/packages/trpc/routers/lists.ts @@ -5,21 +5,15 @@ import { z } from "zod"; import { SqliteError } from "@hoarder/db"; import { bookmarkLists, bookmarksInLists } from "@hoarder/db/schema"; -import { zBookmarkListSchema } from "@hoarder/shared/types/lists"; +import { + zBookmarkListSchema, + zNewBookmarkListSchema, +} from "@hoarder/shared/types/lists"; import type { Context } from "../index"; import { authedProcedure, router } from "../index"; import { ensureBookmarkOwnership } from "./bookmarks"; -const zNewBookmarkListSchema = z.object({ - name: z - .string() - .min(1, "List name can't be empty") - .max(40, "List name is at most 40 chars"), - icon: z.string(), - parentId: z.string().nullish(), -}); - export const ensureListOwnership = experimental_trpcMiddleware<{ ctx: Context; input: { listId: string }; -- cgit v1.2.3-70-g09d2