Merge pull request #11082 from demarches-simplifiees/etq-admin-fix-ordered-services

ETQ Admin, je veux que la liste des services soit classée par ordre alphabétique
This commit is contained in:
Colin Darie 2024-11-26 09:28:41 +00:00 committed by GitHub
commit 3b16e8f190
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,7 @@ module Administrateurs
skip_before_action :alert_for_missing_service, only: :edit skip_before_action :alert_for_missing_service, only: :edit
def index def index
@procedure = procedure @procedure = procedure
@services = services.ordered.sort_by { |service| service == procedure.service ? 0 : 1 } @services = ([procedure.service].compact + services.ordered).uniq
end end
def new def new