From 0f1db02ca5f7518372df876456bb5eec9b767bfc Mon Sep 17 00:00:00 2001 From: yulia-bel Date: Thu, 19 Oct 2023 12:56:56 +0200 Subject: [PATCH] Fix GeoFeaturesService.saveAmountRangeForFeatures() query --- .../api/src/modules/geo-features/geo-features.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/apps/api/src/modules/geo-features/geo-features.service.ts b/api/apps/api/src/modules/geo-features/geo-features.service.ts index a8d8a7a848..4298036206 100644 --- a/api/apps/api/src/modules/geo-features/geo-features.service.ts +++ b/api/apps/api/src/modules/geo-features/geo-features.service.ts @@ -843,11 +843,12 @@ export class GeoFeaturesService extends AppBaseService< const minAndMaxAmountsForFeatures = await this.geoEntityManager .createQueryBuilder() .select('feature_id', 'id') - .select('MIN(amount)', 'amountMin') + .addSelect('MIN(amount)', 'amountMin') .addSelect('MAX(amount)', 'amountMax') .from('puvspr_calculations', 'puvspr') .where('puvspr.feature_id IN (:...featureIds)', { featureIds }) - .getMany(); + .groupBy('puvspr.feature_id') + .getRawMany(); await this.geoFeaturesRepository.save(minAndMaxAmountsForFeatures); }