feat: add followers and following pages with API integration, enhance profile page with follower/following counts

This commit is contained in:
2025-09-06 22:22:44 +02:00
parent dc92945962
commit 8ddbf45a09
6 changed files with 183 additions and 13 deletions

View File

@@ -208,4 +208,20 @@ export const getThoughtById = (thoughtId: string, token: string | null) =>
{},
ThoughtSchema, // Expect a single thought object
token
);
export const getFollowingList = (username: string, token: string | null) =>
apiFetch(
`/users/${username}/following`,
{},
z.object({ users: z.array(UserSchema) }),
token
);
export const getFollowersList = (username: string, token: string | null) =>
apiFetch(
`/users/${username}/followers`,
{},
z.object({ users: z.array(UserSchema) }),
token
);