Show last updated on leaderboard

This commit is contained in:
AbdBarho
2023-01-20 13:00:59 +01:00
parent c81967fca9
commit 0c5e2fc45d
4 changed files with 27 additions and 10 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ import { LeaderboardTimeFrame } from "src/types/Leaderboard";
* Returns the set of valid labels that can be applied to messages.
*/
const handler = withoutRole("banned", async (req, res) => {
const time_frame = (req.query.time_frame as LeaderboardTimeFrame) || LeaderboardTimeFrame.day;
const { leaderboard } = await oasstApiClient.fetch_leaderboard(time_frame);
res.status(200).json(leaderboard);
const time_frame = (req.query.time_frame as LeaderboardTimeFrame) ?? LeaderboardTimeFrame.day;
const info = await oasstApiClient.fetch_leaderboard(time_frame);
res.status(200).json(info);
});
export default handler;