demarches-normaliennes/app/jobs/annuaire_education_update_job.rb
Pierre de La Morinerie 150ddab660 zeitwerk: Api -> API
2021-02-09 13:07:30 +01:00

16 lines
354 B
Ruby

class AnnuaireEducationUpdateJob < ApplicationJob
def perform(champ)
external_id = champ.external_id
if external_id.present?
data = APIEducation::AnnuaireEducationAdapter.new(external_id).to_params
if data.present?
champ.data = data
else
champ.external_id = nil
end
champ.save!
end
end
end