tinker with the page query for game list

This commit is contained in:
iamBadgers
2024-05-18 18:47:09 -07:00
parent 97aab587df
commit 8025424f7b
3 changed files with 49 additions and 56 deletions

View File

@@ -49,9 +49,11 @@ app.post('/api/game', jsonParser, async (req, res) => {
order: orderBy,
where: filter
})
const pageCount = Math.ceil((await Game.count({
where: filter
})) / count)
const pageCount = Math.ceil(
(await Game.count({
where: filter
})) / count
)
res.setHeader('Content-Type', 'application/json')
res.send({ gameData, pageCount })