chore: regenerate Supabase types (includes matrix_credentials + matrix_space_id), remove db() cast workarounds
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user