diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-01 11:31:35 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-01 11:31:35 +0100 |
commit | ee62a2fd5ac44d67fd60e75989f03ea653aa2c54 (patch) | |
tree | 9f2eee4cf6f9902013958ebe850991ca5440526a /app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 | |
parent | d6e724d90fd8a5fd93ef1f4963e22ccaf29b06de (diff) | |
download | gitlab-ce-ee62a2fd5ac44d67fd60e75989f03ea653aa2c54.tar.gz |
Moved update headline HTML into discussion model
Diffstat (limited to 'app/assets/javascripts/diff_notes/components/resolve_btn.js.es6')
-rw-r--r-- | app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 b/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 index b2542e6664d..e1611928049 100644 --- a/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 +++ b/app/assets/javascripts/diff_notes/components/resolve_btn.js.es6 @@ -25,6 +25,9 @@ } }, computed: { + discussion: function () { + return this.discussions[this.discussionId]; + }, note: function () { return CommentsStore.get(this.discussionId, this.noteId); }, @@ -63,14 +66,14 @@ } promise.then((response) => { - const data = response.json(); this.loading = false; if (response.status === 200) { + const data = response.json(); const resolved_by = data ? data.resolved_by : null; CommentsStore.update(this.discussionId, this.noteId, !this.isResolved, resolved_by); - ResolveService.updateDiscussionHeadline(this.discussionId, data); + this.discussion.updateHeadline(data); } else { new Flash('An error occurred when trying to resolve a comment. Please try again.', 'alert'); } |