Commit 4d1bc2c3 authored by Bryce Johnson's avatar Bryce Johnson

Fixup widget and approvals store.

parent 735067df
......@@ -23,21 +23,20 @@
fetch() {
return this.api.fetchApprovals()
.then((res) => this.assignToRootStore(res.data));
.then(res => this.assignToRootStore(res.data));
}
approve() {
return this.api.approveMergeRequest()
.then((data) => this.rootStore.assignToData(data));
.then(res => this.rootStore.assignToData(res.data));
}
unapprove() {
return this.api.unapproveMergeRequest()
.then((data) => this.rootStore.assignToData(data));
.then(res => this.rootStore.assignToData(res.data));
}
}
gl.ApprovalsStore = ApprovalsStore;
})();
......@@ -5,7 +5,7 @@
$(() => {
const rootEl = document.getElementById('merge-request-widget-app');
const widgetSharedStore = new gl.MergeRequestWidgetStore(rootEl); // TODO: encapsulate better
const widgetSharedStore = new gl.MergeRequestWidgetStore(rootEl);
gl.MergeRequestWidgetApp = new Vue({
el: rootEl,
......
......@@ -22,8 +22,8 @@
}
initApprovals() {
const approvalsStore = new gl.ApprovalsStore(this);
this.assignToData('approvals', approvalsStore.data);
gl.ApprovalsStore = new gl.ApprovalsStore(this);
this.assignToData('approvals', this.dataset.approvals);
}
assignToData(key, val) {
......
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