2024-04-15 15:06:05 +02:00
|
|
|
class Champs::OptionsController < Champs::ChampController
|
2023-08-03 11:06:40 +02:00
|
|
|
include TurboChampsConcern
|
|
|
|
|
2023-03-29 23:31:13 +02:00
|
|
|
def remove
|
2024-04-15 15:06:05 +02:00
|
|
|
@champ.remove_option([params[:option]].compact, true)
|
2024-04-22 10:47:47 +02:00
|
|
|
@champ.reload
|
2024-04-15 15:06:05 +02:00
|
|
|
@dossier = @champ.private? ? nil : @champ.dossier
|
2024-04-22 14:22:52 +02:00
|
|
|
champs_attributes = { @champ.public_id => params[:champ_id].present? ? { id: @champ.id } : { with_public_id: true } }
|
2024-04-15 15:06:05 +02:00
|
|
|
@to_show, @to_hide, @to_update = champs_to_turbo_update(champs_attributes, @champ.dossier.champs)
|
2023-03-29 23:31:13 +02:00
|
|
|
end
|
|
|
|
end
|