fix: use term 'count' for X-Total-Count header

This commit is contained in:
Aaron William Po
2023-11-13 14:57:15 -05:00
parent f55570fc1c
commit 6641a45705
5 changed files with 10 additions and 10 deletions

View File

@@ -47,11 +47,11 @@ const getAllBeersByBrewery = async (
},
});
const pageCount = await DBClient.instance.beerPost.count({
const count = await DBClient.instance.beerPost.count({
where: { breweryId: id },
});
res.setHeader('X-Total-Count', pageCount);
res.setHeader('X-Total-Count', count);
res.status(200).json({
message: 'Beers fetched successfully',

View File

@@ -67,11 +67,11 @@ const getAll = async (
pageSize: parseInt(page_size, 10),
});
const pageCount = await DBClient.instance.breweryComment.count({
const count = await DBClient.instance.breweryComment.count({
where: { breweryPostId },
});
res.setHeader('X-Total-Count', pageCount);
res.setHeader('X-Total-Count', count);
res.status(200).json({
message: 'Beer comments fetched successfully',