Add fallback for listProfiles

cgen-00a8278f945146f2bd563c52b6bc8e74
This commit is contained in:
Builder.io 2025-10-04 21:35:57 +00:00
parent 89a9973440
commit 9fa20c53c6

View file

@ -344,6 +344,21 @@ export const aethexUserService = {
},
async listProfiles(limit = 50): Promise<AethexUserProfile[]> {
if (!isSupabaseConfigured) {
return mockAuth.getAllProfiles().slice(0, limit).map((row) =>
normalizeProfile(
{
...row,
user_type: (row as any)?.user_type || "game_developer",
experience_level: (row as any)?.experience_level || "beginner",
total_xp: (row as any)?.total_xp ?? 0,
level: (row as any)?.level ?? 1,
},
(row as any)?.email,
),
);
}
ensureSupabase();
const { data, error } = await supabase