Merge branch 'dev' into instruct-filter-yes-no
This commit is contained in:
commit
adaf0753b0
33 changed files with 410 additions and 306 deletions
|
@ -19,7 +19,7 @@ class Champs::CarteController < ApplicationController
|
|||
def create
|
||||
champ = policy_scope(Champ).find(params[:champ_id])
|
||||
geo_area = champ.geo_areas.selections_utilisateur.new
|
||||
save_geometry!(geo_area, params_feature)
|
||||
save_feature!(geo_area, params_feature)
|
||||
|
||||
render json: { feature: geo_area.to_feature }, status: :created
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ class Champs::CarteController < ApplicationController
|
|||
def update
|
||||
champ = policy_scope(Champ).find(params[:champ_id])
|
||||
geo_area = champ.geo_areas.selections_utilisateur.find(params[:id])
|
||||
save_geometry!(geo_area, params_feature)
|
||||
save_feature!(geo_area, params_feature)
|
||||
|
||||
head :no_content
|
||||
end
|
||||
|
@ -43,7 +43,7 @@ class Champs::CarteController < ApplicationController
|
|||
champ = policy_scope(Champ).find(params[:champ_id])
|
||||
params_features.each do |feature|
|
||||
geo_area = champ.geo_areas.selections_utilisateur.new
|
||||
save_geometry!(geo_area, feature)
|
||||
save_feature!(geo_area, feature)
|
||||
end
|
||||
|
||||
render json: champ.to_feature_collection, status: :created
|
||||
|
@ -59,8 +59,13 @@ class Champs::CarteController < ApplicationController
|
|||
params[:features]
|
||||
end
|
||||
|
||||
def save_geometry!(geo_area, feature)
|
||||
geo_area.geometry = feature[:geometry]
|
||||
def save_feature!(geo_area, feature)
|
||||
if feature[:geometry]
|
||||
geo_area.geometry = feature[:geometry]
|
||||
end
|
||||
if feature[:properties] && feature[:properties][:description]
|
||||
geo_area.description = feature[:properties][:description]
|
||||
end
|
||||
geo_area.save!
|
||||
end
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class Champs::SiretController < ApplicationController
|
|||
@champ = policy_scope(Champ).find(params[:champ_id])
|
||||
@etablissement = @champ&.etablissement
|
||||
end
|
||||
@procedure_id = @champ&.dossier&.procedure_id || 'aperçu'
|
||||
@procedure_id = @champ&.dossier&.procedure&.id || 'aperçu'
|
||||
end
|
||||
|
||||
def find_etablissement_with_siret
|
||||
|
|
|
@ -5,7 +5,7 @@ module Instructeurs
|
|||
@dossiers = DossierSearchService.matching_dossiers_for_instructeur(@search_terms, current_instructeur)
|
||||
@followed_dossiers_id = current_instructeur
|
||||
.followed_dossiers
|
||||
.where(procedure_id: @dossiers.pluck(:procedure_id))
|
||||
.where(groupe_instructeur_id: @dossiers.pluck(:groupe_instructeur_id))
|
||||
.pluck(:id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue