Commit 47881254 authored by Phil Hughes's avatar Phil Hughes

Moved json parsing out of service

[ci skip]
parent 3d553954
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
}, },
deleteIssuable() { deleteIssuable() {
this.service.deleteIssuable() this.service.deleteIssuable()
.then(res => res.json())
.then((data) => { .then((data) => {
// Stop the poll so we don't get 404's with the issue not existing // Stop the poll so we don't get 404's with the issue not existing
this.poll.stop(); this.poll.stop();
......
...@@ -20,12 +20,10 @@ export default class Service { ...@@ -20,12 +20,10 @@ export default class Service {
} }
deleteIssuable() { deleteIssuable() {
return this.resource.delete() return this.resource.delete();
.then(res => res.json());
} }
updateIssuable(data) { updateIssuable(data) {
return this.resource.update(data) return this.resource.update(data);
.then(res => res.json());
} }
} }
...@@ -134,7 +134,9 @@ describe('Issuable output', () => { ...@@ -134,7 +134,9 @@ describe('Issuable output', () => {
spyOn(gl.utils, 'visitUrl'); spyOn(gl.utils, 'visitUrl');
spyOn(vm.service, 'deleteIssuable').and.callFake(() => new Promise((resolve) => { spyOn(vm.service, 'deleteIssuable').and.callFake(() => new Promise((resolve) => {
resolve({ resolve({
path: '/test', json() {
return { path: '/test' };
},
}); });
})); }));
...@@ -154,7 +156,9 @@ describe('Issuable output', () => { ...@@ -154,7 +156,9 @@ describe('Issuable output', () => {
spyOn(vm.poll, 'stop'); spyOn(vm.poll, 'stop');
spyOn(vm.service, 'deleteIssuable').and.callFake(() => new Promise((resolve) => { spyOn(vm.service, 'deleteIssuable').and.callFake(() => new Promise((resolve) => {
resolve({ resolve({
path: '/test', json() {
return { path: '/test' };
},
}); });
})); }));
......
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