Fixes: Resolve entire discussion thread (#95)

This MR adjusts the comment/discussion resolution action to resolve the entire discussion thread, rather than an individual comment, which is the expected behavior during an MR review.
This commit is contained in:
johnybx
2023-11-15 14:10:26 +01:00
committed by GitHub
parent cd21cdb723
commit a5d5dc09ef
6 changed files with 85 additions and 23 deletions

View File

@@ -214,15 +214,8 @@ func EditComment(w http.ResponseWriter, r *http.Request) {
options := gitlab.UpdateMergeRequestDiscussionNoteOptions{}
/* The PATCH can either be to the resolved status of
the discussion or or the text of the comment */
msg := "edit comment"
if editCommentRequest.Comment == "" {
options.Resolved = &editCommentRequest.Resolved
msg = "update discussion status"
} else {
options.Body = gitlab.String(editCommentRequest.Comment)
}
options.Body = gitlab.String(editCommentRequest.Comment)
note, res, err := c.git.Discussions.UpdateMergeRequestDiscussionNote(c.projectId, c.mergeId, editCommentRequest.DiscussionId, editCommentRequest.NoteId, &options)