diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-31 15:43:18 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-09-21 10:07:24 +0100 |
commit | 5461a5d10ae9179e28b9914e5c567d7eec56c79b (patch) | |
tree | 6d4c66e35d63ca1fa1a766fb392fe6cba343ee96 /app/assets/javascripts/diff_notes/services | |
parent | 6df3dd9d5ed6c16d60f560c906dded888d845953 (diff) | |
download | gitlab-ce-5461a5d10ae9179e28b9914e5c567d7eec56c79b.tar.gz |
Pass the full project path for resolve buttons
This fixes an issue that would stop the resolve buttons working when GitLab is installed with a relative URL
Closes #21704
Diffstat (limited to 'app/assets/javascripts/diff_notes/services')
-rw-r--r-- | app/assets/javascripts/diff_notes/services/resolve.js.es6 | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/app/assets/javascripts/diff_notes/services/resolve.js.es6 b/app/assets/javascripts/diff_notes/services/resolve.js.es6 index de771ff814b..2a55f739b31 100644 --- a/app/assets/javascripts/diff_notes/services/resolve.js.es6 +++ b/app/assets/javascripts/diff_notes/services/resolve.js.es6 @@ -9,32 +9,32 @@ Vue.http.headers.common['X-CSRF-Token'] = $.rails.csrfToken(); } - prepareRequest(namespace) { + prepareRequest(root) { this.setCSRF(); - Vue.http.options.root = `/${namespace}`; + Vue.http.options.root = root; } - resolve(namespace, noteId) { - this.prepareRequest(namespace); + resolve(projectPath, noteId) { + this.prepareRequest(projectPath); return this.noteResource.save({ noteId }, {}); } - unresolve(namespace, noteId) { - this.prepareRequest(namespace); + unresolve(projectPath, noteId) { + this.prepareRequest(projectPath); return this.noteResource.delete({ noteId }, {}); } - toggleResolveForDiscussion(namespace, mergeRequestId, discussionId) { + toggleResolveForDiscussion(projectPath, mergeRequestId, discussionId) { const discussion = CommentsStore.state[discussionId], isResolved = discussion.isResolved(); let promise; if (isResolved) { - promise = this.unResolveAll(namespace, mergeRequestId, discussionId); + promise = this.unResolveAll(projectPath, mergeRequestId, discussionId); } else { - promise = this.resolveAll(namespace, mergeRequestId, discussionId); + promise = this.resolveAll(projectPath, mergeRequestId, discussionId); } promise.then((response) => { @@ -57,10 +57,10 @@ }) } - resolveAll(namespace, mergeRequestId, discussionId) { + resolveAll(projectPath, mergeRequestId, discussionId) { const discussion = CommentsStore.state[discussionId]; - this.prepareRequest(namespace); + this.prepareRequest(projectPath); discussion.loading = true; @@ -70,10 +70,10 @@ }, {}); } - unResolveAll(namespace, mergeRequestId, discussionId) { + unResolveAll(projectPath, mergeRequestId, discussionId) { const discussion = CommentsStore.state[discussionId]; - this.prepareRequest(namespace); + this.prepareRequest(projectPath); discussion.loading = true; |