This commit is contained in:
2024-09-02 16:58:23 +02:00
parent c77503ed45
commit 1b0dc0f27d
52 changed files with 817 additions and 1379 deletions

View File

@@ -7,13 +7,7 @@ export default defineEventHandler(async (event) => {
const body = await useValidatedBody(event, UpdateTabSchema)
await useDrizzle()
.update(tables.tabs)
.set({
name: body.name,
icon: body.icon,
color: body.color,
primary: body.primary,
link: body.link,
})
.set(body)
.where(
and(
eq(tables.tabs.id, id),

View File

@@ -4,14 +4,7 @@ import { CreateTabSchema } from '~~/types/types'
export default defineEventHandler(async (event) => {
try {
const body = await useValidatedBody(event, CreateTabSchema)
await useDrizzle().insert(tables.tabs).values({
name: body.name,
icon: body.icon,
color: body.color,
nameVisible: body.nameVisible,
categoryId: body.categoryId,
link: body.link,
})
await useDrizzle().insert(tables.tabs).values(body)
return { statusCode: 200 }
}
catch (err) {