From c12b79ac179de8af3567c6beede785a3f54af331 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 30 Sep 2025 22:53:32 +0000 Subject: [PATCH] Update createInitialProfile to remove mock fallback cgen-72d47237768349d1b223c597d8a4bd54 --- client/lib/aethex-database-adapter.ts | 52 +++------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/client/lib/aethex-database-adapter.ts b/client/lib/aethex-database-adapter.ts index 6236bf19..776ca81f 100644 --- a/client/lib/aethex-database-adapter.ts +++ b/client/lib/aethex-database-adapter.ts @@ -252,29 +252,8 @@ export const aethexUserService = { userId: string, profileData: Partial, ): Promise { - if (!isSupabaseConfigured) { - const mock = await mockAuth.updateProfile( - userId as any, - { - username: profileData.username || `user_${Date.now()}`, - full_name: profileData.full_name, - bio: profileData.bio, - location: profileData.location, - linkedin_url: profileData.linkedin_url as any, - github_url: profileData.github_url as any, - twitter_url: profileData.twitter_url as any, - level: 1, - total_xp: 0, - } as any, - ); - return { - ...(mock as any), - onboarded: true, - role: "member", - loyalty_points: 0, - } as any; - } - // Only insert fields that exist in the actual database schema + ensureSupabase(); + const { data, error } = await supabase .from("user_profiles") .insert({ @@ -299,37 +278,14 @@ export const aethexUserService = { .single(); if (error) { - console.warn("Error creating profile, attempting mock fallback:", error); if (isTableMissing(error)) { - const mock = await mockAuth.updateProfile( - userId as any, - { - username: profileData.username || `user_${Date.now()}`, - full_name: profileData.full_name, - bio: profileData.bio, - location: profileData.location, - linkedin_url: profileData.linkedin_url as any, - github_url: profileData.github_url as any, - twitter_url: profileData.twitter_url as any, - level: 1, - total_xp: 0, - } as any, + throw new Error( + "Supabase table \"user_profiles\" is missing. Please run the required migrations.", ); - - return { - ...(mock as any), - onboarded: true, - role: "member", - loyalty_points: 0, - } as any; } throw error; } - try { - await mockAuth.updateProfile(userId as any, data as any); - } catch {} - return { ...data, onboarded: true,