normalize boolean values (#8320)
* 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
This commit is contained in:
parent
22ecbc2ffb
commit
fa6fc077b4
25 changed files with 292 additions and 101 deletions
|
@ -5,12 +5,8 @@ module Mutations
|
|||
argument :value, Boolean, required: true
|
||||
|
||||
def resolve(dossier:, annotation_id:, instructeur:, value:)
|
||||
resolve_with_type(dossier:, annotation_id:, instructeur:, value:) do |type_champ, value|
|
||||
if type_champ == TypeDeChamp.type_champs.fetch(:yes_no)
|
||||
value ? 'true' : 'false'
|
||||
else
|
||||
value ? 'on' : 'off'
|
||||
end
|
||||
resolve_with_type(dossier:, annotation_id:, instructeur:, value:) do |_, value|
|
||||
value ? 'true' : 'false'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue