Feat: implement client side functionality for user follow feature

This commit is contained in:
Aaron William Po
2023-11-27 22:04:55 -05:00
parent e0e22ba7af
commit 7c87be09cf
11 changed files with 300 additions and 25 deletions

View File

@@ -34,7 +34,7 @@ const useGetUsersFollowingUser = ({
return { followers: parsedPayload.data, pageCount, followerCount: count };
};
const { data, error, isLoading, setSize, size } = useSWRInfinite(
const { data, error, isLoading, setSize, size, mutate } = useSWRInfinite(
(index) =>
`/api/users/${userId}/followers?page_num=${index + 1}&page_size=${pageSize}`,
fetcher,
@@ -57,6 +57,7 @@ const useGetUsersFollowingUser = ({
isLoading,
isLoadingMore,
isAtEnd,
mutate,
error: error as unknown,
};
};