Skip to content

Commit

Permalink
Fix all-time leaderboard data
Browse files Browse the repository at this point in the history
  • Loading branch information
NeutronicMC committed Jun 29, 2020
1 parent c3be9f8 commit 219e9d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hive-tools-wrapper",
"version": "1.0.0",
"version": "1.0.1",
"description": "Advanced Hive Bedrock API wrapper with caching.",
"main": "HiveApi.js",
"types": "HiveApi.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/HiveApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class HiveToolsAPI extends ApiClient {
const params = {
game,
};
const response = await this.getData('/game/monthly/player/{game}/{player}/{year}/{month}', params);
const response = await this.getData('/game/all/{game}', params);
return this.calculateExtraLeaderboardStats(response.data, game, "all");
}

Expand Down
6 changes: 6 additions & 0 deletions test/Api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ test('cache returns cached data', async () => {
const diff = (new Date().getTime()) - start;

expect(diff).toBeLessThan(5);
});

test('all time api returns correct data', async () => {
let data = await HiveApi.getAllTimeLeaderboard("wars");

expect(data).toBeLessThan(5);
});

0 comments on commit 219e9d0

Please sign in to comment.