diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-07-12 17:47:09 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-07-12 17:47:09 +0300 |
commit | aaa78199c2408a05d81aa4ee3058e81bb732da16 (patch) | |
tree | 97146599b47da2f86a1701c6012f60103bad9352 /app/assets/javascripts/environments | |
parent | fd692d10663e5d3c7dc0de9221d6231b7fbcc464 (diff) |
Update vue-resource
Diffstat (limited to 'app/assets/javascripts/environments')
-rw-r--r-- | app/assets/javascripts/environments/mixins/environments_mixin.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/app/assets/javascripts/environments/mixins/environments_mixin.js b/app/assets/javascripts/environments/mixins/environments_mixin.js index 25b24fbd6dc..8f4066e3a6e 100644 --- a/app/assets/javascripts/environments/mixins/environments_mixin.js +++ b/app/assets/javascripts/environments/mixins/environments_mixin.js @@ -1,17 +1,15 @@ export default { methods: { saveData(resp) { - const response = { - headers: resp.headers, - body: resp.json(), - }; + const headers = resp.headers; + return resp.json().then((response) => { + this.isLoading = false; - this.isLoading = false; - - this.store.storeAvailableCount(response.body.available_count); - this.store.storeStoppedCount(response.body.stopped_count); - this.store.storeEnvironments(response.body.environments); - this.store.setPagination(response.headers); + this.store.storeAvailableCount(response.available_count); + this.store.storeStoppedCount(response.stopped_count); + this.store.storeEnvironments(response.environments); + this.store.setPagination(headers); + }); }, }, }; |