Expose revisions on GraphQL API
This commit is contained in:
parent
3b89d04098
commit
91bc2db594
6 changed files with 99 additions and 19 deletions
|
@ -63,6 +63,18 @@ describe API::V2::GraphqlController do
|
|||
email
|
||||
}
|
||||
}
|
||||
revisions {
|
||||
id
|
||||
}
|
||||
draftRevision {
|
||||
id
|
||||
}
|
||||
publishedRevision {
|
||||
id
|
||||
champDescriptors {
|
||||
type
|
||||
}
|
||||
}
|
||||
service {
|
||||
nom
|
||||
typeOrganisme
|
||||
|
@ -123,6 +135,16 @@ describe API::V2::GraphqlController do
|
|||
label: "défaut"
|
||||
}
|
||||
],
|
||||
revisions: procedure.revisions.map { |revision| { id: revision.to_typed_id } },
|
||||
draftRevision: { id: procedure.draft_revision.to_typed_id },
|
||||
publishedRevision: {
|
||||
id: procedure.published_revision.to_typed_id,
|
||||
champDescriptors: procedure.published_types_de_champ.map do |tdc|
|
||||
{
|
||||
type: tdc.type_champ
|
||||
}
|
||||
end
|
||||
},
|
||||
service: {
|
||||
nom: procedure.service.nom,
|
||||
typeOrganisme: procedure.service.type_organisme,
|
||||
|
@ -255,6 +277,12 @@ describe API::V2::GraphqlController do
|
|||
number
|
||||
label
|
||||
}
|
||||
revision {
|
||||
id
|
||||
champDescriptors {
|
||||
type
|
||||
}
|
||||
}
|
||||
messages {
|
||||
email
|
||||
body
|
||||
|
@ -314,6 +342,14 @@ describe API::V2::GraphqlController do
|
|||
number: dossier.groupe_instructeur.id,
|
||||
label: dossier.groupe_instructeur.label
|
||||
},
|
||||
revision: {
|
||||
id: dossier.revision.to_typed_id,
|
||||
champDescriptors: dossier.types_de_champ.map do |tdc|
|
||||
{
|
||||
type: tdc.type_champ
|
||||
}
|
||||
end
|
||||
},
|
||||
demandeur: {
|
||||
id: dossier.individual.to_typed_id,
|
||||
nom: dossier.individual.nom,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue