Commit e965311a authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'approvals-bug' into 'master'

Force JSON parsing of approvals API response data.

Closes #1575

See merge request !1095
parents 1917ad89 4e03161c
...@@ -36,19 +36,19 @@ ...@@ -36,19 +36,19 @@
fetch() { fetch() {
return this.api.fetchApprovals() return this.api.fetchApprovals()
.then(res => this.assignToRootStore('approvals', res.data)) .then(res => this.assignToRootStore('approvals', res.json()))
.then(data => this.setMergeRequestAcceptanceStatus(data.approvals_left)); .then(data => this.setMergeRequestAcceptanceStatus(data.approvals_left));
} }
approve() { approve() {
return this.api.approveMergeRequest() return this.api.approveMergeRequest()
.then(res => this.assignToRootStore('approvals', res.data)) .then(res => this.assignToRootStore('approvals', res.json()))
.then(data => this.setMergeRequestAcceptanceStatus(data.approvals_left)); .then(data => this.setMergeRequestAcceptanceStatus(data.approvals_left));
} }
unapprove() { unapprove() {
return this.api.unapproveMergeRequest() return this.api.unapproveMergeRequest()
.then(res => this.assignToRootStore('approvals', res.data)) .then(res => this.assignToRootStore('approvals', res.json()))
.then(data => this.setMergeRequestAcceptanceStatus(data.approvals_left)); .then(data => this.setMergeRequestAcceptanceStatus(data.approvals_left));
} }
......
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