leaderboard and weapon stats

This commit is contained in:
ScrawnyRonnie 2024-03-16 19:10:16 -04:00
parent bd5e3c9043
commit 67708b166d
7 changed files with 528 additions and 0 deletions

View file

@ -62,4 +62,16 @@ api.get('/user/:user/logins', NEED_SESSION, async (req, res, next) => {
}
});
api.get('/avatar/:avatar/weaponstats', async (req, res, next) => {
const avatar = req.params.avatar;
try {
const weapons = await db.get_weaponstats_by_avatar(avatar);
res.status(200).json({ weapons: weapons });
} catch (e) {
console.log(e);
res.status(500).json({ message: 'error' });
}
});
export default api;