Fallback getProfileById when table missing
cgen-03d7ccafa8f0483ca6fbc43738805d28
This commit is contained in:
parent
b3cd4c9bbf
commit
04667c4a8f
1 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue