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); }