feat(routing): add departements options to value tag if routing by communes

This commit is contained in:
Eric Leroy-Terquem 2023-09-11 16:31:01 +02:00
parent 50d0587a81
commit d1cf60585a
2 changed files with 2 additions and 2 deletions

View file

@ -79,7 +79,7 @@ class Procedure::OneGroupeManagementComponent < ApplicationComponent
return [] if targeted_champ.is_a?(Logic::Empty)
case @revision.types_de_champ_public.find_by(stable_id: targeted_champ.stable_id).type_champ
when TypeDeChamp.type_champs.fetch(:departements)
when TypeDeChamp.type_champs.fetch(:communes), TypeDeChamp.type_champs.fetch(:departements)
departements_for_select
when TypeDeChamp.type_champs.fetch(:regions)
regions_for_select

View file

@ -105,7 +105,7 @@ class GroupeInstructeur < ApplicationRecord
routing_tdc = procedure.active_revision.types_de_champ.find_by(stable_id: routing_rule.left.stable_id)
options = case routing_tdc.type_champ
when TypeDeChamp.type_champs.fetch(:departements)
when TypeDeChamp.type_champs.fetch(:communes), TypeDeChamp.type_champs.fetch(:departements)
APIGeoService.departements.map { _1[:code] }
when TypeDeChamp.type_champs.fetch(:regions)
APIGeoService.regions.map { _1[:code] }