Clean code

This commit is contained in:
Björn Fromme
2018-10-16 16:59:41 +02:00
parent 88b9d68037
commit 716dfcb67a
2 changed files with 2 additions and 6 deletions
@@ -45,8 +45,7 @@ export default new Vuex.Store({
sessionStorage.setItem('token', response.data.token); sessionStorage.setItem('token', response.data.token);
commit('loginSuccess'); commit('loginSuccess');
commit('loading', false); commit('loading', false);
return response.data.token; }).catch((error) => {
}, (error) => {
commit('loginFailure'); commit('loginFailure');
commit('loading', false); commit('loading', false);
throw error; throw error;
@@ -61,7 +60,6 @@ export default new Vuex.Store({
}).then(() => { }).then(() => {
sessionStorage.removeItem('token'); sessionStorage.removeItem('token');
commit('logout'); commit('logout');
return true;
}); });
}, },
loadCountries ({ commit }) { loadCountries ({ commit }) {
@@ -69,7 +67,6 @@ export default new Vuex.Store({
url: '/api/countries', url: '/api/countries',
}).then((response) => { }).then((response) => {
commit('setCountries', response.data); commit('setCountries', response.data);
return response.data;
}) })
} }
}, },
@@ -46,9 +46,8 @@
this.$store.dispatch('login', { this.$store.dispatch('login', {
email: this.email, email: this.email,
password: this.password password: this.password
}).then((token) => { }).then(() => {
this.$router.push({ name: 'address' }); this.$router.push({ name: 'address' });
return token;
}).catch(() => { }).catch(() => {
this.message = 'Der Login ist fehlgeschlagen :('; this.message = 'Der Login ist fehlgeschlagen :(';
}).then(() => { }).then(() => {