2020-07-28 18:16:03 +02:00
|
|
|
|
module Mutations
|
|
|
|
|
class DossierModifierAnnotationCheckbox < Mutations::DossierModifierAnnotation
|
|
|
|
|
description "Modifier l’annotation au format oui/non."
|
|
|
|
|
|
|
|
|
|
argument :value, Boolean, required: true
|
|
|
|
|
|
|
|
|
|
def resolve(dossier:, annotation_id:, instructeur:, value:)
|
|
|
|
|
resolve_with_type(
|
2022-07-21 14:54:14 +02:00
|
|
|
|
dossier: dossier,
|
|
|
|
|
annotation_id: annotation_id,
|
|
|
|
|
instructeur: instructeur,
|
|
|
|
|
value: value
|
2020-07-28 18:16:03 +02:00
|
|
|
|
) do |type_champ, value|
|
|
|
|
|
if type_champ == TypeDeChamp.type_champs.fetch(:yes_no)
|
|
|
|
|
value ? 'true' : 'false'
|
|
|
|
|
else
|
|
|
|
|
value ? 'on' : 'off'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2022-07-21 14:54:14 +02:00
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def input_type
|
|
|
|
|
:checkbox
|
|
|
|
|
end
|
2020-07-28 18:16:03 +02:00
|
|
|
|
end
|
|
|
|
|
end
|