From f00c6db83f1f8b0bbb35230cfede0cfddfc9f7da Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Sat, 26 Jan 2019 00:56:53 +0100 Subject: Add new spec for updateStoreState method --- app/assets/javascripts/issue_show/components/app.vue | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/assets/javascripts/issue_show') diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index 72398cb547a..c2c80218a87 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -212,9 +212,8 @@ export default { } return undefined; }, - updateStoreState() { - this.service + return this.service .getData() .then(res => res.data) .then(data => { @@ -252,12 +251,9 @@ export default { if (window.location.pathname !== data.web_url) { visitUrl(data.web_url); } - - return this.service.getData(); }) - .then(res => res.data) - .then(data => { - this.store.updateState(data); + .then(this.updateStoreState) + .then(() => { eventHub.$emit('close.form'); }) .catch(error => { -- cgit v1.2.1