mirror of
https://github.com/psforever/PSFPortal.git
synced 2026-07-16 00:44:40 +00:00
Added API get for character sorted by BEP stats
This commit is contained in:
parent
623bd5a0d2
commit
45de4d3ecf
1 changed files with 18 additions and 0 deletions
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;
|
export default api;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue