From 219e9d0c70e3da53d1a04a28659c0e4bd8e99511 Mon Sep 17 00:00:00 2001 From: NeutronicMC Date: Mon, 29 Jun 2020 15:15:34 -0700 Subject: [PATCH] Fix all-time leaderboard data --- package.json | 2 +- src/HiveApi.ts | 2 +- test/Api.test.ts | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5df63b7..4668373 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/HiveApi.ts b/src/HiveApi.ts index 2c35a5e..d933dc2 100644 --- a/src/HiveApi.ts +++ b/src/HiveApi.ts @@ -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"); } diff --git a/test/Api.test.ts b/test/Api.test.ts index d06d378..2b2cac4 100644 --- a/test/Api.test.ts +++ b/test/Api.test.ts @@ -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); }); \ No newline at end of file