diff --git a/api/src/modules/eudr-alerts/eudr.controller.ts b/api/src/modules/eudr-alerts/eudr.controller.ts index a0479b7c4..ff36d1521 100644 --- a/api/src/modules/eudr-alerts/eudr.controller.ts +++ b/api/src/modules/eudr-alerts/eudr.controller.ts @@ -225,6 +225,16 @@ export class EudrController { async getGeoFeatureList( @Query(ValidationPipe) dto: GetEUDRFeaturesGeoJSONDto, ): Promise { + if (dto.originIds) { + dto.originIds = await this.adminRegionsService.getAdminRegionDescendants( + dto.originIds, + ); + } + if (dto.materialIds) { + dto.materialIds = await this.materialsService.getMaterialsDescendants( + dto.materialIds, + ); + } return this.geoRegionsService.getGeoJson({ ...dto, eudr: true }); } @@ -238,6 +248,16 @@ export class EudrController { async getGeoFeatureCollection( @Query(ValidationPipe) dto: GetEUDRFeaturesGeoJSONDto, ): Promise { + if (dto.originIds) { + dto.originIds = await this.adminRegionsService.getAdminRegionDescendants( + dto.originIds, + ); + } + if (dto.materialIds) { + dto.materialIds = await this.materialsService.getMaterialsDescendants( + dto.materialIds, + ); + } return this.geoRegionsService.getGeoJson({ ...dto, eudr: true,