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