Skip to content
Snippets Groups Projects
Commit e540a112 authored by Ben Whitmore's avatar Ben Whitmore
Browse files

fix(review): fix a small error in cache update

parent d9376f22
No related branches found
No related tags found
No related merge requests found
...@@ -206,7 +206,7 @@ const ReviewPage = ({ match, ...props }) => { ...@@ -206,7 +206,7 @@ const ReviewPage = ({ match, ...props }) => {
[] []
).find(statusTemp => statusTemp.user === currentUser.id) || {} ).find(statusTemp => statusTemp.user === currentUser.id) || {}
const updateReview = (review, file) => { const updateReview = review => {
const reviewData = { const reviewData = {
recommendation: review.recommendation, recommendation: review.recommendation,
manuscriptId: manuscript.id, manuscriptId: manuscript.id,
...@@ -243,7 +243,7 @@ const ReviewPage = ({ match, ...props }) => { ...@@ -243,7 +243,7 @@ const ReviewPage = ({ match, ...props }) => {
if ( if (
existingReviewRefs.some( existingReviewRefs.some(
ref => readField('id', ref) === updateReview.id, ref => readField('id', ref) === updateReviewTemp.id,
) )
) { ) {
return existingReviewRefs return existingReviewRefs
......
...@@ -5,8 +5,7 @@ const resolvers = { ...@@ -5,8 +5,7 @@ const resolvers = {
Mutation: { Mutation: {
async updateReview(_, { id, input }, ctx) { async updateReview(_, { id, input }, ctx) {
// We process comment fields into array // We process comment fields into array
input.user = ctx.user const processedReview = { ...input, user: ctx.user }
const processedReview = Object.assign({}, input)
processedReview.comments = [ processedReview.comments = [
input.reviewComment, input.reviewComment,
input.confidentialComment, input.confidentialComment,
...@@ -34,9 +33,11 @@ const resolvers = { ...@@ -34,9 +33,11 @@ const resolvers = {
async completeReview(_, { id }, ctx) { async completeReview(_, { id }, ctx) {
const review = await ctx.models.Review.query().findById(id) const review = await ctx.models.Review.query().findById(id)
const manuscript = await ctx.models.Manuscript.query().findById( const manuscript = await ctx.models.Manuscript.query().findById(
review.manuscriptId, review.manuscriptId,
) )
const team = await manuscript const team = await manuscript
.$relatedQuery('teams') .$relatedQuery('teams')
.where('role', 'reviewer') .where('role', 'reviewer')
......
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