Add AI-assisted world and character drafting flows
All checks were successful
CI / validate (push) Successful in 14m3s

This commit is contained in:
2026-08-17 09:25:37 +05:00
parent 830aa5dc1f
commit cdeea8653c
23 changed files with 811 additions and 92 deletions

View File

@@ -45,14 +45,14 @@ if (!supabaseUrl || !serviceKey) {
}
async function databaseRequest<T>(path: string, init: RequestInit = {}): Promise<T> {
const headers = new Headers(init.headers)
headers.set('apikey', databaseServiceKey)
headers.set('Content-Type', 'application/json')
if (databaseServiceKey.split('.').length === 3) headers.set('Authorization', `Bearer ${databaseServiceKey}`)
else headers.delete('Authorization')
const response = await fetch(new URL(`/rest/v1/${path}`, databaseUrl), {
...init,
headers: {
apikey: databaseServiceKey,
Authorization: `Bearer ${databaseServiceKey}`,
'Content-Type': 'application/json',
...init.headers,
},
headers,
})
if (!response.ok) {
const detail = await response.text()