From 45de4d3ecf927eeb491bd9585675cb7c6a27f09a Mon Sep 17 00:00:00 2001 From: GeekOfWires Date: Sun, 20 Sep 2020 05:17:47 -0400 Subject: [PATCH] Added API get for character sorted by BEP stats --- api/stats.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/api/stats.js b/api/stats.js index 6984992..4605658 100644 --- a/api/stats.js +++ b/api/stats.js @@ -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; \ No newline at end of file