Commit 831d7f68 authored by Audrey Hamelers's avatar Audrey Hamelers
parent efa41e02
Pipeline #13069 passed with stages
in 5 minutes and 41 seconds
......@@ -19,6 +19,8 @@ xslt4node.addLibrary('./saxon9he.jar')
xslt4node.addOptions('-Xmx1g')
module.exports.pushXML = async function pushXML(fileUrl, manuscriptId, userId) {
const man = await Manuscript.findById(manuscriptId, userId)
const changeStatus = ['tagging', 'xml-qa'].includes(man.status)
try {
await Manuscript.update(
{ id: manuscriptId, formState: null, pdfDepositState: 'CREATING_NXML' },
......@@ -62,7 +64,7 @@ module.exports.pushXML = async function pushXML(fileUrl, manuscriptId, userId) {
{
id: manuscriptId,
formState: errString,
status: 'xml-triage',
status: changeStatus ? 'xml-triage' : man.status,
pdfDepositState: null,
},
userId,
......@@ -104,7 +106,7 @@ module.exports.pushXML = async function pushXML(fileUrl, manuscriptId, userId) {
{
id: manuscriptId,
formState: errString,
status: 'xml-triage',
status: changeStatus ? 'xml-triage' : man.status,
pdfDepositState: null,
},
userId,
......@@ -227,7 +229,7 @@ module.exports.pushXML = async function pushXML(fileUrl, manuscriptId, userId) {
{
id: manuscriptId,
formState: errString,
status: 'xml-triage',
status: changeStatus ? 'xml-triage' : man.status,
},
userId,
)
......@@ -251,7 +253,7 @@ module.exports.pushXML = async function pushXML(fileUrl, manuscriptId, userId) {
{
id: manuscriptId,
formState: styleErrString,
status: 'xml-triage',
status: changeStatus ? 'xml-triage' : man.status,
pdfDepositState: null,
},
userId,
......@@ -264,7 +266,7 @@ module.exports.pushXML = async function pushXML(fileUrl, manuscriptId, userId) {
{
id: manuscriptId,
formState: err.message,
status: 'xml-triage',
status: changeStatus ? 'xml-triage' : man.status,
pdfDepositState: null,
},
userId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment