c2-mongoose 2.1.20 → 2.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,8 +91,8 @@ var SearchFlow = /** @class */ (function () {
91
91
  this.orderBy = params.orderBy || "_id";
92
92
  this.select = params.select;
93
93
  this.populate = params.populate;
94
- this.page = params.page || undefined;
95
- this.limit = params.limit || 25;
94
+ this.page = Number(params.page || undefined);
95
+ this.limit = Number(params.limit || 25);
96
96
  this.buildPopulate();
97
97
  }
98
98
  SearchFlow.prototype.buildPopulate = function () {
@@ -181,8 +181,8 @@ var SearchFlow = /** @class */ (function () {
181
181
  total = _a.sent();
182
182
  paging = {};
183
183
  paging.total = total;
184
- paging.page = this.page;
185
- paging.limit = this.limit;
184
+ paging.page = Number(this.page);
185
+ paging.limit = Number(this.limit);
186
186
  searchResponse = {};
187
187
  searchResponse.items = items;
188
188
  searchResponse.paging = paging;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-mongoose",
3
- "version": "2.1.20",
3
+ "version": "2.1.21",
4
4
  "description": "Lib to make any search in database mongoose and use as basic crud",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,8 +20,8 @@ abstract class SearchFlow {
20
20
  this.orderBy = params.orderBy || "_id"
21
21
  this.select = params.select
22
22
  this.populate = params.populate
23
- this.page = params.page || undefined
24
- this.limit = params.limit || 25
23
+ this.page = Number(params.page || undefined)
24
+ this.limit = Number(params.limit || 25)
25
25
  this.buildPopulate()
26
26
  }
27
27
 
@@ -122,8 +122,8 @@ abstract class SearchFlow {
122
122
 
123
123
  var paging: Pagination = {}
124
124
  paging.total = total
125
- paging.page = this.page
126
- paging.limit = this.limit
125
+ paging.page = Number(this.page)
126
+ paging.limit = Number(this.limit)
127
127
 
128
128
  var searchResponse: SearchResponse<any> = {}
129
129
  searchResponse.items = items