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

fix(authsome): Skip validating recommendations for fragments that don't have any

parent 34dbff04
No related branches found
No related tags found
1 merge request!110Sprint 21 Features
...@@ -252,12 +252,14 @@ async function updateReviewerVisibleStatusByInvitation({ ...@@ -252,12 +252,14 @@ async function updateReviewerVisibleStatusByInvitation({
const fragmentId = last(collection.fragments) const fragmentId = last(collection.fragments)
const fragment = await FragmentModel.find(fragmentId) const fragment = await FragmentModel.find(fragmentId)
const invitation = fragment.invitations.find(inv => inv.userId === user.id) const invitation = fragment.invitations.find(inv => inv.userId === user.id)
const recommendationDone = fragment.recommendations.some( const recommendationDone =
rec => fragment.recommendations &&
rec.recommendationType === 'review' && fragment.recommendations.some(
rec.userId === user.id && rec =>
rec.submittedOn, rec.recommendationType === 'review' &&
) rec.userId === user.id &&
rec.submittedOn,
)
if (recommendationDone) { if (recommendationDone) {
return get(statuses, `${collection.status}.reviewer.label`) return get(statuses, `${collection.status}.reviewer.label`)
......
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