@baapcompany/core-api
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "@baapcompany/core-api", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -129,2 +129,18 @@ const ServiceResponse = require("@baapcompany/core-api/services/serviceResponse"); | ||
async paginationResults(query, pagination) { | ||
return this.execute(async () => { | ||
return { | ||
items: await this.model.find( | ||
query, | ||
{}, | ||
{ | ||
skip: pagination.pageSize * (pagination.pageNumber - 1), | ||
limit: pagination.pageSize, | ||
} | ||
), | ||
totalItemsCount: await this.model.countDocuments(query), | ||
}; | ||
}); | ||
} | ||
validateAndSanitizePaginationProps(pagination) { | ||
@@ -131,0 +147,0 @@ if (!pagination.pageNumber) { |
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
13819
215