Skip to content
Snippets Groups Projects
Commit 042b99c2 authored by Sebastian Mihalache's avatar Sebastian Mihalache :hammer_pick:
Browse files

Merge branch 'HIN-230-eic-request-revision' of...

Merge branch 'HIN-230-eic-request-revision' of gitlab.coko.foundation:xpub/xpub-faraday into HIN-230-eic-request-revision
parents 6e67e9c2 328a85c6
No related branches found
No related tags found
3 merge requests!196S25 - EiC submit revision,!189S25,!177Hin 230 eic request revision
......@@ -32,7 +32,7 @@ module.exports = models => async (req, res) => {
const { collectionId, fragmentId } = req.params
let collection, fragment, fragments
let collection, fragment
try {
collection = await models.Collection.find(collectionId)
......@@ -50,18 +50,6 @@ module.exports = models => async (req, res) => {
const collectionHelper = new Collection({ collection })
try {
fragments = await collectionHelper.getAllFragments({
FragmentModel: models.Fragment,
})
} catch (e) {
const notFoundError = await services.handleNotFoundError(e, 'Item')
fragments = []
return res.status(notFoundError.status).json({
error: notFoundError.message,
})
}
const authsome = authsomeHelper.getAuthsome(models)
const target = {
fragment,
......@@ -143,7 +131,6 @@ module.exports = models => async (req, res) => {
await strategies[role][recommendation].execute({
userId,
models,
fragments,
notification,
fragmentHelper,
collectionHelper,
......
module.exports = {
execute: async ({
userId,
fragments,
notification,
fragmentHelper,
collectionHelper,
newRecommendation,
}) => {
const fragments = await collectionHelper.collection.getFragments()
if (!collectionHelper.canHEMakeRecommendation(fragments, fragmentHelper)) {
throw new Error('Cannot publish without at least one reviewer report.')
}
......
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