From b5fe845114cb1c57a67a60b41bc77b6953379c2b Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 18 Oct 2025 04:41:13 +0000 Subject: [PATCH] Append getFollowers to social service cgen-7e9f14663514469a85d6064b77233afc --- client/lib/aethex-social-service.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/lib/aethex-social-service.ts b/client/lib/aethex-social-service.ts index 8ce35ff6..6da37dd4 100644 --- a/client/lib/aethex-social-service.ts +++ b/client/lib/aethex-social-service.ts @@ -52,6 +52,19 @@ 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 { + return []; + } + }, + async followUser(followerId: string, followingId: string): Promise { const resp = await fetch("/api/social/follow", { method: "POST",