Skip to content
Snippets Groups Projects
Commit afecf1b6 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

fix(manuscript-manager): fix eic check on recommendation

parent d0e910d4
No related branches found
No related tags found
1 merge request!10Sprint #12
...@@ -7,7 +7,6 @@ const mailService = require('pubsweet-component-mail-service') ...@@ -7,7 +7,6 @@ const mailService = require('pubsweet-component-mail-service')
module.exports = models => async (req, res) => { module.exports = models => async (req, res) => {
const { recommendation, comments, recommendationType } = req.body const { recommendation, comments, recommendationType } = req.body
if (!helpers.checkForUndefinedParams(recommendationType)) if (!helpers.checkForUndefinedParams(recommendationType))
return res.status(400).json({ error: 'Recommendation type is required.' }) return res.status(400).json({ error: 'Recommendation type is required.' })
...@@ -35,7 +34,6 @@ module.exports = models => async (req, res) => { ...@@ -35,7 +34,6 @@ module.exports = models => async (req, res) => {
collection, collection,
path: req.route.path, path: req.route.path,
} }
const canPost = await authsome.can(req.user, 'POST', target) const canPost = await authsome.can(req.user, 'POST', target)
if (!canPost) if (!canPost)
return res.status(403).json({ return res.status(403).json({
...@@ -52,7 +50,7 @@ module.exports = models => async (req, res) => { ...@@ -52,7 +50,7 @@ module.exports = models => async (req, res) => {
newRecommendation.recommendation = recommendation || undefined newRecommendation.recommendation = recommendation || undefined
newRecommendation.comments = comments || undefined newRecommendation.comments = comments || undefined
if (reqUser.editorInChief === true) { if (reqUser.editorInChief || reqUser.admin) {
await collectionHelper.updateFinalStatusByRecommendation( await collectionHelper.updateFinalStatusByRecommendation(
collection, collection,
recommendation, recommendation,
...@@ -62,7 +60,6 @@ module.exports = models => async (req, res) => { ...@@ -62,7 +60,6 @@ module.exports = models => async (req, res) => {
collection, collection,
recommendation, recommendation,
) )
const { const {
title, title,
submittingAuthor, submittingAuthor,
......
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