Add fallback for listProfiles
cgen-00a8278f945146f2bd563c52b6bc8e74
This commit is contained in:
parent
89a9973440
commit
9fa20c53c6
1 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue