2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-01-14 17:29:57 +01:00
|
|
|
class Champs::AnnuaireEducationChamp < Champs::TextChamp
|
2021-02-09 12:35:23 +01:00
|
|
|
def fetch_external_data?
|
|
|
|
true
|
2021-01-14 17:29:57 +01:00
|
|
|
end
|
|
|
|
|
2021-02-09 12:35:23 +01:00
|
|
|
def fetch_external_data
|
2021-02-19 11:29:08 +01:00
|
|
|
APIEducation::AnnuaireEducationAdapter.new(external_id).to_params
|
2021-01-14 17:29:57 +01:00
|
|
|
end
|
2023-02-28 13:55:52 +01:00
|
|
|
|
2024-05-06 18:09:44 +02:00
|
|
|
def selected_items
|
|
|
|
if external_id.present?
|
|
|
|
[{ value: external_id, label: value }]
|
2023-02-28 13:55:52 +01:00
|
|
|
else
|
2024-05-06 18:09:44 +02:00
|
|
|
[]
|
2023-02-28 13:55:52 +01:00
|
|
|
end
|
|
|
|
end
|
2021-01-14 17:29:57 +01:00
|
|
|
end
|