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

Commit 03ddd8e

Browse files
committed
Merge pull request #738 from appirio-tech/comments-bug
Fix saving comments
2 parents 017d0cc + d57d1e1 commit 03ddd8e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

app/services/helpers.service.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ import angular from 'angular'
124124

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

130132
if (answerObject.answer !== '') {
@@ -148,15 +150,15 @@ import angular from 'angular'
148150
answer: '' + q.answer
149151
}
150152

151-
if (q.comment && q.comment.length > 0) {
152-
reviewItem.comments = [
153-
{
154-
content: '' + q.comment,
155-
resourceId: review.resourceId,
156-
commentTypeId: 1
157-
}
158-
]
159-
}
153+
reviewItem.comments = [
154+
{
155+
content: '' + q.comment,
156+
id: q.commentId,
157+
resourceId: review.resourceId,
158+
commentTypeId: 1,
159+
reviewItemId: q.reviewItemId
160+
}
161+
]
160162

161163
if (updating) {
162164
reviewItem.id = q.reviewItemId

0 commit comments

Comments
 (0)