Append getFollowers to social service

cgen-7e9f14663514469a85d6064b77233afc
This commit is contained in:
Builder.io 2025-10-18 04:41:13 +00:00
parent 33396c9aef
commit b5fe845114

View file

@ -52,6 +52,19 @@ export const aethexSocialService = {
}
},
async getFollowers(userId: string): Promise<string[]> {
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<void> {
const resp = await fetch("/api/social/follow", {
method: "POST",