c2-mongoose 2.1.57 → 2.1.58
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.
|
@@ -17,7 +17,7 @@ declare abstract class SearchFlow {
|
|
|
17
17
|
buildOrdenation(): any;
|
|
18
18
|
buildRegex(searchText: string): RegExp;
|
|
19
19
|
searchPageable(model: mongoose.Model<any>, options: SearchOptions): Promise<{
|
|
20
|
-
items: any
|
|
20
|
+
items: any;
|
|
21
21
|
paging: any;
|
|
22
22
|
}>;
|
|
23
23
|
search(model: mongoose.Model<any>, options?: SearchOptions): Promise<SearchResponse<any>>;
|
package/dist/flow/SearchFlow.js
CHANGED
|
@@ -148,7 +148,7 @@ var SearchFlow = /** @class */ (function () {
|
|
|
148
148
|
SearchFlow.prototype.searchPageable = function (model, options) {
|
|
149
149
|
var _a;
|
|
150
150
|
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
-
var stagesItems, result
|
|
151
|
+
var stagesItems, result;
|
|
152
152
|
return __generator(this, function (_b) {
|
|
153
153
|
switch (_b.label) {
|
|
154
154
|
case 0:
|
|
@@ -177,12 +177,8 @@ var SearchFlow = /** @class */ (function () {
|
|
|
177
177
|
]).session(options === null || options === void 0 ? void 0 : options.session)];
|
|
178
178
|
case 1:
|
|
179
179
|
result = _b.sent();
|
|
180
|
-
populate = __assign(__assign({}, this.populate), { select: this.select });
|
|
181
|
-
return [4 /*yield*/, model.populate(result[0].items, populate)];
|
|
182
|
-
case 2:
|
|
183
|
-
items = _b.sent();
|
|
184
180
|
return [2 /*return*/, {
|
|
185
|
-
items: items,
|
|
181
|
+
items: result[0].items,
|
|
186
182
|
paging: ((_a = result[0]) === null || _a === void 0 ? void 0 : _a.paging[0]) || { total: 0, page: 1, limit: this.limit }
|
|
187
183
|
}];
|
|
188
184
|
}
|
package/package.json
CHANGED
package/src/flow/SearchFlow.ts
CHANGED
|
@@ -103,14 +103,8 @@ abstract class SearchFlow {
|
|
|
103
103
|
}
|
|
104
104
|
]
|
|
105
105
|
).session(options?.session as ClientSession)
|
|
106
|
-
let populate = {
|
|
107
|
-
...this.populate,
|
|
108
|
-
select: this.select
|
|
109
|
-
}
|
|
110
|
-
let items = await model.populate(result[0].items, populate)
|
|
111
|
-
|
|
112
106
|
return {
|
|
113
|
-
items: items,
|
|
107
|
+
items: result[0].items,
|
|
114
108
|
paging: result[0]?.paging[0] || { total: 0, page: 1, limit: this.limit }
|
|
115
109
|
}
|
|
116
110
|
}
|