Skip to content
Snippets Groups Projects
Commit 15bb416c authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

feat(component-manuscript-manager): fix status after review

parent 5b3525f7
No related branches found
No related tags found
1 merge request!10Sprint #12
......@@ -12,6 +12,12 @@ const updateStatusByRecommendation = async (collection, recommendation) => {
await collection.save()
}
const updateStatus = async (collection, newStatus) => {
collection.status = newStatus
collection.visibleStatus = statuses[collection.status].private
await collection.save()
}
const getFragmentAndAuthorData = async ({
UserModel,
FragmentModel,
......@@ -47,4 +53,5 @@ module.exports = {
updateStatusByRecommendation,
getFragmentAndAuthorData,
getAgreedReviewerInvitation,
updateStatus,
}
......@@ -46,10 +46,7 @@ module.exports = models => async (req, res) => {
mailService,
})
if (!['pendingApproval', 'revisionRequested'].includes(collection.status))
await collectionHelper.updateStatusByRecommendation(
collection,
recommendation,
)
await collectionHelper.updateStatus(collection, 'reviewCompleted')
}
await fragment.save()
return res.status(200).json(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