Working event base
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { serverSupabaseClient } from "#supabase/server";
|
||||
import { z } from 'zod'
|
||||
import type { Character } from "~/models/Characters";
|
||||
|
||||
const querySchema = z.object({
|
||||
world_id: z.number({ coerce: true }).positive().int()
|
||||
@@ -18,12 +19,13 @@ export default defineEventHandler(async (event) => {
|
||||
birth,
|
||||
death,
|
||||
wiki,
|
||||
characters_category (id, name)
|
||||
category:character_categories!characters_category_fkey (*),
|
||||
secondaryCategories:character_categories!character_categories_links (*)
|
||||
`)
|
||||
|
||||
if (query.world_id) {
|
||||
output.eq('world_id', query.world_id)
|
||||
}
|
||||
|
||||
return output
|
||||
return output.returns<Character[]>()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user