c2-mongoose 2.1.26 → 2.1.28
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.
package/dist/flow/SearchFlow.js
CHANGED
|
@@ -84,7 +84,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
84
84
|
this.populate = params.populate;
|
|
85
85
|
this.page = Number(params.page || 1);
|
|
86
86
|
this.limit = Number(params.limit || 25);
|
|
87
|
-
this.pageable = params.pageable ==
|
|
87
|
+
this.pageable = params.pageable == false ? false : true;
|
|
88
88
|
this.buildPopulate();
|
|
89
89
|
}
|
|
90
90
|
SearchFlow.prototype.buildPopulate = function () {
|
|
@@ -133,7 +133,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
133
133
|
return __generator(this, function (_a) {
|
|
134
134
|
switch (_a.label) {
|
|
135
135
|
case 0:
|
|
136
|
-
if (!this.pageable) return [3 /*break*/, 2];
|
|
136
|
+
if (!(this.pageable == true)) return [3 /*break*/, 2];
|
|
137
137
|
return [4 /*yield*/, this.searchPageable(model)];
|
|
138
138
|
case 1: return [2 /*return*/, _a.sent()];
|
|
139
139
|
case 2: return [4 /*yield*/, this.searchNoPageable(model)];
|
|
@@ -153,7 +153,6 @@ var SearchFlow = /** @class */ (function () {
|
|
|
153
153
|
.find(this.filters, this.select)
|
|
154
154
|
.populate(this.populate)
|
|
155
155
|
.sort(sort)
|
|
156
|
-
.limit(this.limit)
|
|
157
156
|
.collation({
|
|
158
157
|
locale: Environment_1.dbCollation || "pt"
|
|
159
158
|
})];
|
|
@@ -172,7 +171,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
172
171
|
case 0:
|
|
173
172
|
searchResponse = {};
|
|
174
173
|
searchResponse.items = items;
|
|
175
|
-
if (!this.pageable) return [3 /*break*/, 2];
|
|
174
|
+
if (!(this.pageable == true)) return [3 /*break*/, 2];
|
|
176
175
|
return [4 /*yield*/, this.count(model)];
|
|
177
176
|
case 1:
|
|
178
177
|
total = _a.sent();
|
package/package.json
CHANGED
package/src/flow/CrudFlow.ts
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -23,7 +23,7 @@ abstract class SearchFlow {
|
|
|
23
23
|
this.populate = params.populate
|
|
24
24
|
this.page = Number(params.page || 1)
|
|
25
25
|
this.limit = Number(params.limit || 25)
|
|
26
|
-
this.pageable = params.pageable ==
|
|
26
|
+
this.pageable = params.pageable == false ? false : true
|
|
27
27
|
this.buildPopulate()
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -72,7 +72,7 @@ abstract class SearchFlow {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
public async search(model: mongoose.Model<any>): Promise<SearchResponse<any>> {
|
|
75
|
-
if (this.pageable) {
|
|
75
|
+
if (this.pageable == true) {
|
|
76
76
|
return await this.searchPageable(model)
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -100,7 +100,6 @@ abstract class SearchFlow {
|
|
|
100
100
|
.find(this.filters, this.select)
|
|
101
101
|
.populate(this.populate)
|
|
102
102
|
.sort(sort)
|
|
103
|
-
.limit(this.limit)
|
|
104
103
|
.collation({
|
|
105
104
|
locale: dbCollation || "pt"
|
|
106
105
|
}) as []
|
|
@@ -112,7 +111,7 @@ abstract class SearchFlow {
|
|
|
112
111
|
var searchResponse: SearchResponse<any> = {}
|
|
113
112
|
searchResponse.items = items
|
|
114
113
|
|
|
115
|
-
if (this.pageable) {
|
|
114
|
+
if (this.pageable == true) {
|
|
116
115
|
var total = await this.count(model)
|
|
117
116
|
var paging: Pagination = {}
|
|
118
117
|
paging.total = total
|