c2-mongoose 1.2.0 → 1.3.1
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/model/Search.js +3 -1
- package/package.json +4 -4
- package/src/model/Search.ts +5 -2
package/dist/model/Search.js
CHANGED
|
@@ -229,7 +229,9 @@ var Search = /** @class */ (function () {
|
|
|
229
229
|
condition[key] = { $in: value };
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
if ((0, Utils_1.isNotEmpty)(condition)) {
|
|
233
|
+
filters.$and.push(condition);
|
|
234
|
+
}
|
|
233
235
|
}
|
|
234
236
|
});
|
|
235
237
|
if ((0, Utils_1.isNotEmpty)(objectSearch.model)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-mongoose",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
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",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"preversion": "tsc",
|
|
10
10
|
"postversion": "git push && git push --tags && npm publish",
|
|
11
|
-
"publish-patch": "npm version patch
|
|
12
|
-
"publish-minor": "npm version minor
|
|
13
|
-
"publish-major": "npm version major
|
|
11
|
+
"publish-patch": "npm version patch",
|
|
12
|
+
"publish-minor": "npm version minor",
|
|
13
|
+
"publish-major": "npm version major"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
package/src/model/Search.ts
CHANGED
|
@@ -57,7 +57,7 @@ abstract class Search {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
private isPageable = () => {
|
|
60
|
-
if (isEmpty(this.page)){
|
|
60
|
+
if (isEmpty(this.page)) {
|
|
61
61
|
this.page = 1
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -183,7 +183,10 @@ abstract class Search {
|
|
|
183
183
|
condition[key] = { $in: value }
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
|
|
187
|
+
if (isNotEmpty(condition)) {
|
|
188
|
+
filters.$and.push(condition)
|
|
189
|
+
}
|
|
187
190
|
}
|
|
188
191
|
})
|
|
189
192
|
|