diff --git a/client/lib/aethex-social-service.ts b/client/lib/aethex-social-service.ts index ac2a41b7..7487d0da 100644 --- a/client/lib/aethex-social-service.ts +++ b/client/lib/aethex-social-service.ts @@ -59,13 +59,23 @@ export const aethexSocialService = { async getFollowers(userId: string): Promise { try { - const { data, error } = await supabase - .from("user_follows") - .select("follower_id") - .eq("following_id", userId); - if (error) return []; - return (data as any[]).map((r: any) => r.follower_id); - } catch { + const resp = await fetch( + `${API_BASE}/api/user/followers?userId=${encodeURIComponent(userId)}` + ); + + if (!resp.ok) { + console.error( + "Failed to load followers list: HTTP", + resp.status, + await resp.text(), + ); + return []; + } + + const result = await resp.json(); + return result.data || []; + } catch (error) { + console.error("Unexpected error loading followers list:", error); return []; } },