Commit 9e0229bc authored by Bryce Johnson's avatar Bryce Johnson

Set common approvals endpoint as member.

parent c8cb7f8d
......@@ -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}`);
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment