Added category input component

This commit is contained in:
Alexis
2024-06-10 18:58:08 +02:00
parent e9ec2cb3ae
commit 17b9937c6a
11 changed files with 178 additions and 11 deletions

View File

@@ -0,0 +1,15 @@
import { serverSupabaseClient } from "#supabase/server";
import type { Category } from "~/models/Category";
export default defineEventHandler(async (event) => {
const client = await serverSupabaseClient(event)
const output = client
.from('calendar_event_categories')
.select(`
id,
name
`)
return output.returns<Category[]>()
})

View File

@@ -22,7 +22,6 @@ export default defineEventHandler(async (event) => {
}
if (bodyError) {
console.log(bodyData)
throw createError({
cause: 'Utilisateur',
fatal: false,
@@ -42,6 +41,7 @@ export default defineEventHandler(async (event) => {
description: bodyData.event.description,
location: bodyData.event.location,
hidden: bodyData.event.hidden,
category: bodyData.event.category.id,
calendar_id: bodyData?.calendarId
} as never
)

View File

@@ -26,6 +26,7 @@ export default defineEventHandler(async (event) => {
description: bodyData.event.description,
location: bodyData.event.location,
hidden: bodyData.event.hidden,
category: bodyData.event.category.id,
calendar_id: bodyData?.calendarId
} as never
)