Added API get for character sorted by BEP stats

This commit is contained in:
GeekOfWires 2020-09-20 05:17:47 -04:00
parent 623bd5a0d2
commit 45de4d3ecf

View file

@ -22,4 +22,22 @@ api.get('/char_stats/:batch', async (req, res, next) => {
}
});
api.get('/char_stats_bep/:batch', async (req, res, next) => {
try {
const stats = await db.get_stats();
stats.empires = { "TR": 0, "NC": 0, "VS": 0 }
var batch = req.params.batch;
const avatars = await db.get_character_batch_for_stats(batch, AVATAR.BEP, SQL_ORDER.DESCENDING);
res.status(200).json({ players: avatars });
} catch (e) {
console.log(e);
res.status(500).json({ message: 'error' });
}
});
export default api;