mirror of
https://github.com/psforever/PSFPortal.git
synced 2026-01-19 18:14:45 +00:00
Added API get for character sorted by BEP stats
This commit is contained in:
parent
623bd5a0d2
commit
45de4d3ecf
18
api/stats.js
18
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;
|
||||
Loading…
Reference in a new issue