Skip to content
Snippets Groups Projects
Commit 7ff1ecab authored by Andrei Cioromila's avatar Andrei Cioromila
Browse files

fix(manuscript-manager): await for manuscript status update to guarantee data integrity

parent 50206cb5
No related branches found
No related tags found
3 merge requests!162Sprint 23 Features,!161Deploy S23 features and fixes,!159Hin 1153 status after review
...@@ -92,18 +92,16 @@ class Collection { ...@@ -92,18 +92,16 @@ class Collection {
async updateStatusOnRecommendation({ isEditorInChief, recommendation }) { async updateStatusOnRecommendation({ isEditorInChief, recommendation }) {
if (isEditorInChief) { if (isEditorInChief) {
if (recommendation === 'return-to-handling-editor') { if (recommendation === 'return-to-handling-editor') {
this.updateStatus({ newStatus: 'reviewCompleted' }) return this.updateStatus({ newStatus: 'reviewCompleted' })
} else {
this.updateFinalStatusByRecommendation({
recommendation,
})
} }
} else { return this.updateFinalStatusByRecommendation({
this.updateStatusByRecommendation({
recommendation, recommendation,
isHandlingEditor: true,
}) })
} }
return this.updateStatusByRecommendation({
recommendation,
isHandlingEditor: true,
})
} }
getHELastName() { getHELastName() {
......
...@@ -127,7 +127,7 @@ module.exports = models => async (req, res) => { ...@@ -127,7 +127,7 @@ module.exports = models => async (req, res) => {
newRecommendation.comments = comments || undefined newRecommendation.comments = comments || undefined
if (recommendationType === 'editorRecommendation') { if (recommendationType === 'editorRecommendation') {
collectionHelper.updateStatusOnRecommendation({ await collectionHelper.updateStatusOnRecommendation({
isEditorInChief, isEditorInChief,
recommendation, recommendation,
}) })
......
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