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);
commit('loginSuccess');
commit('loading', false);
return response.data.token;
}, (error) => {
}).catch((error) => {
commit('loginFailure');
commit('loading', false);
throw error;
@@ -61,7 +60,6 @@ export default new Vuex.Store({
}).then(() => {
sessionStorage.removeItem('token');
commit('logout');
return true;
});
},
loadCountries ({ commit }) {
@@ -69,7 +67,6 @@ export default new Vuex.Store({
url: '/api/countries',
}).then((response) => {
commit('setCountries', response.data);
return response.data;
})
}
},
@@ -46,9 +46,8 @@
this.$store.dispatch('login', {
email: this.email,
password: this.password
}).then((token) => {
}).then(() => {
this.$router.push({ name: 'address' });
return token;
}).catch(() => {
this.message = 'Der Login ist fehlgeschlagen :(';
}).then(() => {