Removed the api modification for the qrcode pull request
This commit is contained in:
parent
c1c84ab0f9
commit
ce18b5eae3
1 changed files with 2 additions and 10 deletions
|
|
@ -1,15 +1,7 @@
|
||||||
import { LinkSchema, nanoid } from '@/schemas/link'
|
import { LinkSchema } from '@/schemas/link'
|
||||||
|
|
||||||
export default eventHandler(async (event) => {
|
export default eventHandler(async (event) => {
|
||||||
const body = await readBody(event)
|
const link = await readValidatedBody(event, LinkSchema.parse)
|
||||||
|
|
||||||
// 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 { caseSensitive } = useRuntimeConfig(event)
|
const { caseSensitive } = useRuntimeConfig(event)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue