Fallback getProfileById when table missing

cgen-03d7ccafa8f0483ca6fbc43738805d28
This commit is contained in:
Builder.io 2025-10-01 00:01:19 +00:00
parent b3cd4c9bbf
commit 04667c4a8f

View file

@ -188,9 +188,12 @@ export const aethexUserService = {
}
if (isTableMissing(error)) {
throw new Error(
'Supabase table "user_profiles" is missing. Please run the required migrations.',
);
console.warn('user_profiles table missing during getProfileById - returning local fallback if available');
try {
const raw = localStorage.getItem(`demo_profile_${userId}`);
if (raw) return JSON.parse(raw) as AethexUserProfile;
} catch {}
return null;
}
throw error;