c2-mongoose 2.1.231 → 2.1.233
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.
|
@@ -155,7 +155,6 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
155
155
|
_b.label = 3;
|
|
156
156
|
case 3:
|
|
157
157
|
resultAux = this.transformObject(result[0]);
|
|
158
|
-
this.reset();
|
|
159
158
|
return [2 /*return*/, resultAux];
|
|
160
159
|
}
|
|
161
160
|
});
|
|
@@ -315,20 +314,6 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
315
314
|
.replace(/[u|ü|ú|ù|U|Ú|Ü|Ù]/g, '[u,ü,ú,ù,U,Ú,Ü,Ù]');
|
|
316
315
|
return new RegExp("".concat(regexExpression), 'i');
|
|
317
316
|
};
|
|
318
|
-
SearcherFlow.prototype.reset = function () {
|
|
319
|
-
for (var key in this) {
|
|
320
|
-
delete this[key];
|
|
321
|
-
}
|
|
322
|
-
this.searchText = "";
|
|
323
|
-
this.orderSense = "desc";
|
|
324
|
-
this.orderBy = "_id";
|
|
325
|
-
this.page = 1;
|
|
326
|
-
this.limit = 50;
|
|
327
|
-
this.pageable = true;
|
|
328
|
-
this.select = [""];
|
|
329
|
-
this.populate = [""];
|
|
330
|
-
this.filters = undefined;
|
|
331
|
-
};
|
|
332
317
|
return SearcherFlow;
|
|
333
318
|
}());
|
|
334
319
|
exports.default = SearcherFlow;
|
|
@@ -16,6 +16,9 @@ var BuildSelectSingleFlowItem = /** @class */ (function () {
|
|
|
16
16
|
function BuildSelectSingleFlowItem() {
|
|
17
17
|
}
|
|
18
18
|
BuildSelectSingleFlowItem.prototype.build = function (model, selects) {
|
|
19
|
+
if ((0, Utils_1.isEmpty)(selects)) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
19
22
|
var projection = {};
|
|
20
23
|
for (var _i = 0, selects_1 = selects; _i < selects_1.length; _i++) {
|
|
21
24
|
var field = selects_1[_i];
|
package/package.json
CHANGED
package/src/flow/SearcherFlow.ts
CHANGED
|
@@ -124,7 +124,6 @@ class SearcherFlow<D> {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
let resultAux = this.transformObject(result[0])
|
|
127
|
-
this.reset()
|
|
128
127
|
return resultAux
|
|
129
128
|
}
|
|
130
129
|
|
|
@@ -304,22 +303,6 @@ class SearcherFlow<D> {
|
|
|
304
303
|
.replace(/[u|ü|ú|ù|U|Ú|Ü|Ù]/g, '[u,ü,ú,ù,U,Ú,Ü,Ù]')
|
|
305
304
|
return new RegExp(`${regexExpression}`, 'i');
|
|
306
305
|
}
|
|
307
|
-
|
|
308
|
-
private reset() {
|
|
309
|
-
for (const key in this) {
|
|
310
|
-
delete this[key];
|
|
311
|
-
}
|
|
312
|
-
this.searchText = ""
|
|
313
|
-
this.orderSense = "desc"
|
|
314
|
-
this.orderBy = "_id"
|
|
315
|
-
this.page = 1
|
|
316
|
-
this.limit = 50
|
|
317
|
-
this.pageable = true
|
|
318
|
-
|
|
319
|
-
this.select = [""]
|
|
320
|
-
this.populate = [""]
|
|
321
|
-
this.filters = undefined
|
|
322
|
-
}
|
|
323
306
|
}
|
|
324
307
|
|
|
325
308
|
export default SearcherFlow
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import mongoose from "mongoose"
|
|
2
|
-
import { isNotEmpty } from "../../utils/Utils"
|
|
2
|
+
import { isEmpty, isNotEmpty } from "../../utils/Utils"
|
|
3
3
|
|
|
4
4
|
class BuildSelectSingleFlowItem {
|
|
5
5
|
|
|
6
6
|
build(model: mongoose.Model<any>, selects: string[]) {
|
|
7
7
|
|
|
8
|
+
if (isEmpty(selects)) {
|
|
9
|
+
return undefined
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
let projection: any = {}
|
|
9
13
|
for (var field of selects) {
|
|
10
14
|
let include = field.startsWith("-") ? false : true
|