Removed the api modification for the qrcode pull request

This commit is contained in:
MinerAle 2025-02-24 21:19:33 +01:00
parent c1c84ab0f9
commit ce18b5eae3

View file

@ -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)