From ce18b5eae3158c5a791f04e8618779c9bbbb7016 Mon Sep 17 00:00:00 2001 From: MinerAle <66887063+MinerAle00@users.noreply.github.com> Date: Mon, 24 Feb 2025 21:19:33 +0100 Subject: [PATCH] Removed the api modification for the qrcode pull request --- server/api/link/create.post.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/server/api/link/create.post.ts b/server/api/link/create.post.ts index 7d0977a..e3be9b1 100644 --- a/server/api/link/create.post.ts +++ b/server/api/link/create.post.ts @@ -1,15 +1,7 @@ -import { LinkSchema, nanoid } from '@/schemas/link' +import { LinkSchema } from '@/schemas/link' export default eventHandler(async (event) => { - const body = await readBody(event) - - // If no slug provided, generate one with default length from env or fall back to default - if (!body.slug) { - const { slugDefaultLength } = useRuntimeConfig().public - body.slug = slugDefaultLength ? nanoid(+slugDefaultLength)() : nanoid()() - } - - const link = await LinkSchema.parse(body) + const link = await readValidatedBody(event, LinkSchema.parse) const { caseSensitive } = useRuntimeConfig(event)