fa6fc077b4
* extract parent for yes no and checkbox champs * checkbox stores true / false instead of on / off * normalize blank value to nil * normalize invalid value to false * after party task: normalize checkbox values * after party task: normalize yes_no values
19 lines
474 B
Ruby
19 lines
474 B
Ruby
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(dossier:, annotation_id:, instructeur:, value:) do |_, value|
|
||
value ? 'true' : 'false'
|
||
end
|
||
end
|
||
|
||
private
|
||
|
||
def input_type
|
||
:checkbox
|
||
end
|
||
end
|
||
end
|