Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Fix saving comments #738

Merged
merged 1 commit into from
Feb 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions app/services/helpers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ import angular from 'angular'

if (answerObject.comments && answerObject.comments.length > 0) {
// pick first comment for peer review challenges
// does not handle displaying multiple comments yet
questions[questionId].comment = answerObject.comments[0].content
questions[questionId].commentId = answerObject.comments[0].id
}

if (answerObject.answer !== '') {
Expand All @@ -148,15 +150,15 @@ import angular from 'angular'
answer: '' + q.answer
}

if (q.comment && q.comment.length > 0) {
reviewItem.comments = [
{
content: '' + q.comment,
resourceId: review.resourceId,
commentTypeId: 1
}
]
}
reviewItem.comments = [
{
content: '' + q.comment,
id: q.commentId,
resourceId: review.resourceId,
commentTypeId: 1,
reviewItemId: q.reviewItemId
}
]

if (updating) {
reviewItem.id = q.reviewItemId
Expand Down