@provis/provis-common-be-module 2.2.10 → 2.2.11

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.
@@ -199,9 +199,16 @@ class MainRepository extends typeorm_1.Repository {
199
199
  else {
200
200
  query.innerJoin(`${modelName}.${relation.model}`, relation.model);
201
201
  }
202
+ let index = 0;
202
203
  (_a = relation.searchs) === null || _a === void 0 ? void 0 : _a.forEach((valueSearch) => {
203
204
  if (valueSearch) {
204
- query = query.orWhere(`${relation.model}.${valueSearch.query}`, { [valueSearch.key]: valueSearch.value });
205
+ if (index == 0) {
206
+ query = query.orWhere(`${relation.model}.${valueSearch.query}`, { [valueSearch.key]: valueSearch.value });
207
+ index++;
208
+ }
209
+ else {
210
+ query = query.andWhere(`${relation.model}.${valueSearch.query}`, { [valueSearch.key]: valueSearch.value });
211
+ }
205
212
  }
206
213
  });
207
214
  (_b = relation.additionalSearchOr) === null || _b === void 0 ? void 0 : _b.forEach((group) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provis/provis-common-be-module",
3
- "version": "2.2.10",
3
+ "version": "2.2.11",
4
4
  "description": "This common module for Provis internal backend use lib",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {