aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-02-28 20:27:09 -0600
committermat <27899617+mat-1@users.noreply.github.com>2021-02-28 20:27:09 -0600
commit5c2228adaf07c658824f8df51bf976f61902b7fc (patch)
treeb781cf779148fbee5d99411b9f39e0f01378f39e
parentbc8d11e139d776e7f53050002d298ec3b6e66890 (diff)
parentaff515fb49f56267a6981f423fc14c1712b106eb (diff)
downloadskyblock-api-5c2228adaf07c658824f8df51bf976f61902b7fc.tar.gz
skyblock-api-5c2228adaf07c658824f8df51bf976f61902b7fc.tar.bz2
skyblock-api-5c2228adaf07c658824f8df51bf976f61902b7fc.zip
Merge branch 'main' of https://github.com/skyblockstats/skyblock-api into main
-rw-r--r--build/database.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/build/database.js b/build/database.js
index 208c56a..e7f7385 100644
--- a/build/database.js
+++ b/build/database.js
@@ -78,14 +78,12 @@ function getMemberLeaderboardAttributes(member) {
}
async function fetchAllLeaderboardsCategoriezed() {
const memberLeaderboardAttributes = await fetchAllMemberLeaderboardAttributes();
- const categorizedLeaderboards = [];
+ const categorizedLeaderboards = {};
for (const leaderboard of memberLeaderboardAttributes) {
- const { category, name } = stats_1.categorizeStat(leaderboard);
- categorizedLeaderboards.push({
- category,
- name,
- id: leaderboard
- });
+ const { category } = stats_1.categorizeStat(leaderboard);
+ if (!categorizedLeaderboards[category])
+ categorizedLeaderboards[category] = [];
+ categorizedLeaderboards[category].push(leaderboard);
}
return categorizedLeaderboards;
}