Added API get for character sorted by CEP stats

This commit is contained in:
GeekOfWires 2020-09-20 05:18:09 -04:00
parent 45de4d3ecf
commit 4b314a147d

View file

@ -40,4 +40,22 @@ api.get('/char_stats_bep/:batch', async (req, res, next) => {
}
});
api.get('/char_stats_cep/: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.CEP, SQL_ORDER.DESCENDING);
res.status(200).json({ players: avatars });
} catch (e) {
console.log(e);
res.status(500).json({ message: 'error' });
}
});
export default api;