Skip to content

Commit

Permalink
Fix GeoFeaturesService.saveAmountRangeForFeatures() query
Browse files Browse the repository at this point in the history
  • Loading branch information
yulia-bel committed Oct 19, 2023
1 parent d00eba0 commit 0f1db02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/apps/api/src/modules/geo-features/geo-features.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0f1db02

Please sign in to comment.