adminmate-express-mongoose
Advanced tools
Comparing version 1.3.7 to 1.3.8
{ | ||
"name": "adminmate-express-mongoose", | ||
"version": "1.3.7", | ||
"version": "1.3.8", | ||
"description": "Adminmate Express/Mongoose connector", | ||
@@ -5,0 +5,0 @@ "author": "Marc Delalonde", |
@@ -16,3 +16,3 @@ const { intersection } = require('lodash'); | ||
const page = parseInt(req.query.page || 1); | ||
const nbItemPerPage = 10; | ||
const rowsPerPage = parseInt(req.query.rows || 10); | ||
const defaultOrdering = [ ['_id', 'DESC'] ]; | ||
@@ -93,4 +93,4 @@ const order = req.query.order || null; | ||
.sort(orderSafe) | ||
.skip(nbItemPerPage * (page - 1)) | ||
.limit(nbItemPerPage) | ||
.skip(rowsPerPage * (page - 1)) | ||
.limit(rowsPerPage) | ||
.lean() | ||
@@ -106,3 +106,3 @@ .catch(e => { | ||
const dataCount = await currentModel.countDocuments(findParams); | ||
const nbPage = Math.ceil(dataCount / nbItemPerPage); | ||
const nbPage = Math.ceil(dataCount / rowsPerPage); | ||
@@ -129,3 +129,4 @@ // Make ref fields appeared as link in the dashboard | ||
current: page, | ||
count: nbPage | ||
count: nbPage, | ||
rows_per_page: rowsPerPage | ||
} | ||
@@ -132,0 +133,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45081
1337