c2-mongoose 2.1.269 → 2.1.270
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.
|
@@ -67,6 +67,7 @@ var BuildSelectSingleFlowItem_1 = __importDefault(require("./item/BuildSelectSin
|
|
|
67
67
|
var SearcherFlow = /** @class */ (function () {
|
|
68
68
|
function SearcherFlow(repository) {
|
|
69
69
|
this.searchText = "";
|
|
70
|
+
this.searchTextFields = [];
|
|
70
71
|
this.orderSense = "desc";
|
|
71
72
|
this.orderBy = "_id";
|
|
72
73
|
this.page = 1;
|
|
@@ -213,7 +214,7 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
213
214
|
SearcherFlow.prototype.buildDefaultFilters = function (objectSearch) {
|
|
214
215
|
var _this = this;
|
|
215
216
|
// Recuperar todos os campos do tipo String
|
|
216
|
-
var camposString = this.extractFieldsOfType(this.model.schema, 'String');
|
|
217
|
+
var camposString = (0, Utils_1.isEmpty)(this.searchTextFields) ? this.extractFieldsOfType(this.model.schema, 'String') : this.searchTextFields;
|
|
217
218
|
var filters = { $and: [] };
|
|
218
219
|
Object.entries(objectSearch).forEach(function (_a) {
|
|
219
220
|
var _b, _c, _d;
|
|
@@ -235,6 +236,7 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
235
236
|
'model',
|
|
236
237
|
'select',
|
|
237
238
|
'searchText',
|
|
239
|
+
'searchTextFields',
|
|
238
240
|
'sort',
|
|
239
241
|
'isPageable',
|
|
240
242
|
'searchPageable'
|
package/package.json
CHANGED
package/src/flow/SearcherFlow.ts
CHANGED
|
@@ -17,6 +17,7 @@ class SearcherFlow<D> {
|
|
|
17
17
|
|
|
18
18
|
[key: string]: any
|
|
19
19
|
public searchText: string = ""
|
|
20
|
+
public searchTextFields: string[] = []
|
|
20
21
|
public orderSense: string = "desc"
|
|
21
22
|
public orderBy: string = "_id"
|
|
22
23
|
public page: number = 1
|
|
@@ -175,7 +176,7 @@ class SearcherFlow<D> {
|
|
|
175
176
|
public buildDefaultFilters(objectSearch: any) {
|
|
176
177
|
|
|
177
178
|
// Recuperar todos os campos do tipo String
|
|
178
|
-
const camposString = this.extractFieldsOfType(this.model.schema, 'String')
|
|
179
|
+
const camposString = isEmpty(this.searchTextFields) ? this.extractFieldsOfType(this.model.schema, 'String') : this.searchTextFields
|
|
179
180
|
|
|
180
181
|
|
|
181
182
|
let filters = { $and: [] } as any
|
|
@@ -197,6 +198,7 @@ class SearcherFlow<D> {
|
|
|
197
198
|
'model',
|
|
198
199
|
'select',
|
|
199
200
|
'searchText',
|
|
201
|
+
'searchTextFields',
|
|
200
202
|
'sort',
|
|
201
203
|
'isPageable',
|
|
202
204
|
'searchPageable'].includes(key)) {
|