From c344dd2316dbda1b31a8e258fa942eeb262803e8 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 28 Mar 2020 10:45:15 +0100 Subject: [PATCH] clean action store --- client/src/store/index.js | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/client/src/store/index.js b/client/src/store/index.js index f981820..cf58011 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -8,30 +8,7 @@ import { isValidJwt, EventBus } from '../utils'; Vue.use(Vuex); const actions = { // asynchronous operations - getchaine(context, { num }) { - return fetchchaine(num) - .then((res) => { - if (res.status === 200) { - context.dispatch('getemission', { chaine: num, name: res.data }); - } else { - context.commit('push_chaine', { chaine: num, name: res.data }); - } - }) - .catch((error) => { - // eslint-disable-next-line - console.error(error); - }); - }, - getemission(context, { chaine, name }) { - return fetchemission(chaine) - .then((resEmission) => { - context.commit('push_chaine', { chaine, name, emission: resEmission.data }); - }) - .catch((error) => { - context.commit('push_chaine', { chaine, name }); - console.error(error); - }); - }, + setStorename(context, userData) { context.commit('setUserData', { userData }); },