completionId: cgen-8d2e6a2757bd459586a90088e0256bf3

cgen-8d2e6a2757bd459586a90088e0256bf3
This commit is contained in:
Builder.io 2025-11-15 02:05:08 +00:00
parent ab9082158f
commit b45894e7ac

View file

@ -33,20 +33,21 @@ export const aethexSocialService = {
async getFollowing(userId: string): Promise<string[]> {
try {
const { data, error } = await supabase
.from("user_follows")
.select("following_id")
.eq("follower_id", userId);
const resp = await fetch(
`${API_BASE}/api/user/following?userId=${encodeURIComponent(userId)}`
);
if (error) {
if (!resp.ok) {
console.error(
"Failed to load following list:",
(error as any)?.message || error,
"Failed to load following list: HTTP",
resp.status,
await resp.text(),
);
return [];
}
return (data as any[]).map((r: any) => r.following_id);
const result = await resp.json();
return result.data || [];
} catch (error) {
console.error(
"Unexpected error loading following list:",