Merge pull request #5225 from betagouv/5224-fix-effectifs

ask effectifs only for 2020/02
This commit is contained in:
Keirua 2020-06-04 09:30:27 +02:00 committed by GitHub
commit 94862340f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,8 @@
class ApiEntreprise::EffectifsJob < ApiEntreprise::Job
def perform(etablissement_id, procedure_id)
etablissement = Etablissement.find(etablissement_id)
etablissement_params = ApiEntreprise::EffectifsAdapter.new(etablissement.siret, procedure_id, *get_current_valid_month_for_effectif).to_params
# effectifs endpoint currently only works when asking for february 2020 month
etablissement_params = ApiEntreprise::EffectifsAdapter.new(etablissement.siret, procedure_id, "2020", "02").to_params
etablissement.update!(etablissement_params)
end