Update the character list to use the server side table stuff
This commit is contained in:
@@ -33,14 +33,15 @@ export function addCharacterApis(app, jsonParser) {
|
||||
order: orderBy,
|
||||
where: filter
|
||||
})
|
||||
const pageCount = Math.ceil(
|
||||
(await Character.count({
|
||||
const totalCount = await Character.count({
|
||||
where: filter
|
||||
})) / count
|
||||
})
|
||||
const pageCount = Math.ceil(
|
||||
totalCount / count
|
||||
)
|
||||
|
||||
res.setHeader('Content-Type', 'application/json')
|
||||
res.send({ characterData, pageCount })
|
||||
res.send({ characterData, pageCount, totalCount })
|
||||
} catch (e) {
|
||||
if (e instanceof ParsingError) {
|
||||
res.status(400).send('Could not parse filter.')
|
||||
|
||||
Reference in New Issue
Block a user