Skip to content

Commit

Permalink
Update getLeaderboard method with date range parameters #70
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonStnn committed Feb 9, 2025
1 parent bc1793c commit 2b0146e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,20 @@ class BackendAPI {
);
}

public async getLeaderboard(limit?: number, skip?: number) {
public async getLeaderboard(
limit?: number,
skip?: number,
startDate?: Date | null,
endDate?: Date | null
) {
return await this.request<RemoteResponse['leaderboard']>(
'GET',
'/leaderboard',
{
limit,
skip,
'start-date': startDate?.toISOString(),
'end-date': endDate?.toISOString(),
}
);
}
Expand Down

0 comments on commit 2b0146e

Please sign in to comment.