Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9e0229bc
Commit
9e0229bc
authored
Dec 14, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set common approvals endpoint as member.
parent
c8cb7f8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
app/assets/javascripts/merge_request_widget/approvals/services/approvals_api.js.es6
...ge_request_widget/approvals/services/approvals_api.js.es6
+4
-7
No files found.
app/assets/javascripts/merge_request_widget/approvals/services/approvals_api.js.es6
View file @
9e0229bc
...
...
@@ -8,27 +8,24 @@
}
init(mergeRequestEndpoint) {
this.baseEndpoint =
mergeRequestEndpoint
;
this.baseEndpoint =
`${mergeRequestEndpoint}/approvals`
;
Vue.http.headers.common['X-CSRF-Token'] = $.rails.csrfToken();
}
fetchApprovals() {
const endpoint = `${this.baseEndpoint}/approvals`;
return Vue.http.get(endpoint).catch((err) => {
return Vue.http.get(this.baseEndpoint).catch((err) => {
console.error(`Error fetching approvals. ${err}`);
});
}
approveMergeRequest() {
const endpoint = `${this.baseEndpoint}/approvals`;
return Vue.http.post(endpoint).catch((err) => {
return Vue.http.post(this.baseEndpoint).catch((err) => {
console.error(`Error approving merge request. ${err}`);
});
}
unapproveMergeRequest() {
const endpoint = `${this.baseEndpoint}/approvals`;
return Vue.http.delete(endpoint).catch((err) => {
return Vue.http.delete(this.baseEndpoint).catch((err) => {
console.error(`Error unapproving merge request. ${err}`);
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment