chore: regenerate Supabase types (includes matrix_credentials + matrix_space_id), remove db() cast workarounds

This commit is contained in:
AlacrisDevs
2026-02-07 09:25:33 +02:00
parent 45ab939b7f
commit 13cdb605ca
4 changed files with 64 additions and 20 deletions

View File

@@ -1,10 +1,6 @@
import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
// Cast supabase to any — matrix_space_id column added in migration 021
// TODO: Remove after running `supabase gen types`
const db = (supabase: any) => supabase;
/**
* GET: Retrieve the Matrix Space ID for an org
*/
@@ -19,7 +15,7 @@ export const GET: RequestHandler = async ({ url, locals }) => {
return json({ error: 'org_id is required' }, { status: 400 });
}
const { data, error } = await db(locals.supabase)
const { data, error } = await locals.supabase
.from('organizations')
.select('matrix_space_id')
.eq('id', orgId)
@@ -134,7 +130,7 @@ export const POST: RequestHandler = async ({ request, locals }) => {
}
// Store space ID in org record
const { error: updateError } = await db(locals.supabase)
const { error: updateError } = await locals.supabase
.from('organizations')
.update({ matrix_space_id: spaceId })
.eq('id', org_id);
@@ -156,7 +152,7 @@ export const POST: RequestHandler = async ({ request, locals }) => {
return json({ error: 'space_id is required for link action' }, { status: 400 });
}
const { error: updateError } = await db(locals.supabase)
const { error: updateError } = await locals.supabase
.from('organizations')
.update({ matrix_space_id: space_id })
.eq('id', org_id);