Expose draft_revision types_de_champ to editor

This commit is contained in:
Paul Chavard 2020-07-28 16:43:17 +02:00
parent 1fca481c6e
commit a6eef6fb19

View file

@ -22,7 +22,7 @@ module ProcedureHelper
{
isAnnotation: false,
typeDeChampsTypes: TypeDeChamp.type_de_champ_types_for(procedure, current_user),
typeDeChamps: procedure.types_de_champ.as_json_for_editor,
typeDeChamps: (procedure.draft_revision ? procedure.draft_revision : procedure).types_de_champ.as_json_for_editor,
baseUrl: admin_procedure_types_de_champ_path(procedure),
directUploadUrl: rails_direct_uploads_url
}
@ -32,7 +32,7 @@ module ProcedureHelper
{
isAnnotation: true,
typeDeChampsTypes: TypeDeChamp.type_de_champ_types_for(procedure, current_user),
typeDeChamps: procedure.types_de_champ_private.as_json_for_editor,
typeDeChamps: (procedure.draft_revision ? procedure.draft_revision : procedure).types_de_champ_private.as_json_for_editor,
baseUrl: admin_procedure_types_de_champ_path(procedure),
directUploadUrl: rails_direct_uploads_url
}