From c6c21554138339832df213ab5c31d099ae70ca3c Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 30 Sep 2025 22:53:14 +0000 Subject: [PATCH] Update updateProfile to remove mock fallback cgen-a8151420d19b459c8637eca0dd941c84 --- client/lib/aethex-database-adapter.ts | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index dcd428cf..6236bf19 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -213,10 +213,8 @@ export const aethexUserService = { userId: string, updates: Partial, ): Promise { - if (!isSupabaseConfigured) { - const mock = await mockAuth.updateProfile(userId as any, updates as any); - return mock as unknown as AethexUserProfile; - } + ensureSupabase(); + const { data, error } = await supabase .from("user_profiles") .update(updates) @@ -225,13 +223,6 @@ export const aethexUserService = { .single(); if (error) { - if (isTableMissing(error)) { - const mock = await mockAuth.updateProfile( - userId as any, - updates as any, - ); - return mock as unknown as AethexUserProfile; - } if ((error as any)?.code === "PGRST116") { const { data: upserted, error: upsertError } = await supabase .from("user_profiles") @@ -244,13 +235,16 @@ export const aethexUserService = { if (upsertError) throw upsertError; return upserted as AethexUserProfile; } + + if (isTableMissing(error)) { + throw new Error( + "Supabase table \"user_profiles\" is missing. Please run the required migrations.", + ); + } + throw error; } - try { - await mockAuth.updateProfile(userId as any, updates as any); - } catch {} - return data as AethexUserProfile; },