Skip to content

Commit

Permalink
Merge 43732fa into 085c98e
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasulejoseph committed Dec 14, 2019
2 parents 085c98e + 43732fa commit d20b50c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helper/queryHelper.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Expense from "../model/expense";

export default async (queryParams, queryKeys, currentPage) => {
const expPerPage = 6;
const expPerPage = 9;
const requiredParams = [
"status",
"uuid",
Expand All @@ -27,7 +27,7 @@ export default async (queryParams, queryKeys, currentPage) => {
const data = await Expense.find(queryParams)
.skip(expPerPage * currentPage - expPerPage)
.limit(expPerPage);
const count = await Expense.countDocuments();
const count = await Expense.countDocuments(queryParams);
return {
status: 200,
pages: Math.ceil(count / expPerPage),
Expand Down

0 comments on commit d20b50c

Please sign in to comment.