Skip to content

Commit

Permalink
Fix rank count
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandiny committed Feb 25, 2021
1 parent a560f31 commit 8cdc8c3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/controller/UserController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,9 @@ export class UserController {
}
}

const totalCount = await this.globalScoreboardRepository
.createQueryBuilder("leaderboard")
.select("COUNT(DISTINCT(score)) AS total")
.getRawOne();
const totalCount = await this.globalScoreboardRepository.count();

return responseGenerator(response, 200, "ok", { score, rank, total: totalCount.total });
return responseGenerator(response, 200, "ok", { score, rank, total: totalCount });

} catch (err) {
console.error(err);
Expand Down

0 comments on commit 8cdc8c3

Please sign in to comment.