Expose repetitions and options on champ_descriptors

This commit is contained in:
Paul Chavard 2020-07-16 12:50:00 +02:00
parent eb6c4b3dd1
commit 86f562e7ea
3 changed files with 34 additions and 2 deletions

View file

@ -74,6 +74,11 @@ describe API::V2::GraphqlController do
label
description
required
champDescriptors {
id
type
}
options
}
dossiers {
nodes {
@ -129,7 +134,9 @@ describe API::V2::GraphqlController do
label: tdc.libelle,
type: tdc.type_champ,
description: tdc.description,
required: tdc.mandatory?
required: tdc.mandatory?,
champDescriptors: tdc.repetition? ? tdc.reload.types_de_champ.map { |tdc| { id: tdc.to_typed_id, type: tdc.type_champ } } : nil,
options: tdc.drop_down_list? ? tdc.drop_down_list_options.reject(&:empty?) : nil
}
end,
dossiers: {