Skip to content

Commit 8877e62

Browse files
committed
fix(json-api-nestjs): fix incorrect condition
- if result empty do not need call query
1 parent 66c24ca commit 8877e62

File tree

1 file changed

+1
-2
lines changed
  • libs/json-api-nestjs/src/lib/mixin/service/typeorm/methods/get-all

1 file changed

+1
-2
lines changed

libs/json-api-nestjs/src/lib/mixin/service/typeorm/methods/get-all/get-all.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,9 @@ export async function getAll<T>(
188188
resultBuilder.andWhere(expression);
189189
resultBuilder.setParameters(params ? {[params.name]: params.val} : {});
190190
}
191+
result = await resultBuilder.getRawMany();
191192
}
192193

193-
result = await resultBuilder.getRawMany();
194-
195194
const callQuery = Date.now() - startTime;
196195

197196
const entityArray: T[] = this.transform.transformRawData(result);

0 commit comments

Comments
 (0)