Remodeled database and api to prepare for move

This commit is contained in:
Alexis
2024-05-15 17:18:17 +02:00
parent 3a8e8b0947
commit 49e523485b
21 changed files with 479 additions and 274 deletions

View File

@@ -0,0 +1,18 @@
import { serverSupabaseClient } from "#supabase/server";
import type { Character } from "~/models/Characters";
export default defineEventHandler(async (event) => {
const client = await serverSupabaseClient(event)
return client.from('characters')
.select(`
id,
name,
description,
birth,
death,
wiki,
characters_category (id, name)
`)
.returns<Character[]>()
})