Skip to content

Commit 21cbfbb

Browse files
next cursor is sent now
1 parent 4080095 commit 21cbfbb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/api/leaderboard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const leaderBoardResponseSchema = z.object({
2626
data: z.object({
2727
users: z.array(leaderboardUserSchema).nullable(),
2828
}),
29+
next_cursor: z.string(),
2930
});
3031
export type LeaderboardResponse = z.infer<typeof leaderBoardResponseSchema>;
3132

@@ -54,7 +55,7 @@ export const fetchLeaderboard = async ({
5455
const parsedResponse = leaderBoardResponseSchema.parse(response.data);
5556
const users = parsedResponse.data.users;
5657
console.log(users);
57-
const nextCursor = users != null ? users[users.length - 1]?.ID : null;
58+
const nextCursor = parsedResponse.next_cursor;
5859

5960
return {
6061
users,

0 commit comments

Comments
 (0)