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

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.
@@ -190,6 +190,7 @@ class MainRepository extends typeorm_1.Repository {
190
190
  });
191
191
  }
192
192
  if (relations && relations.length > 0) {
193
+ let isFirstJoin = true;
193
194
  relations.forEach((relation) => {
194
195
  var _a, _b;
195
196
  if (relation) {
@@ -203,7 +204,13 @@ class MainRepository extends typeorm_1.Repository {
203
204
  (_a = relation.searchs) === null || _a === void 0 ? void 0 : _a.forEach((valueSearch) => {
204
205
  if (valueSearch) {
205
206
  if (index == 0) {
206
- query = query.orWhere(`${relation.model}.${valueSearch.query}`, { [valueSearch.key]: valueSearch.value });
207
+ if (isFirstJoin) {
208
+ query = query.andWhere(`${relation.model}.${valueSearch.query}`, { [valueSearch.key]: valueSearch.value });
209
+ isFirstJoin = false;
210
+ }
211
+ else {
212
+ query = query.andWhere(`${relation.model}.${valueSearch.query}`, { [valueSearch.key]: valueSearch.value });
213
+ }
207
214
  index++;
208
215
  }
209
216
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provis/provis-common-be-module",
3
- "version": "2.2.11",
3
+ "version": "2.2.13",
4
4
  "description": "This common module for Provis internal backend use lib",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {