From c5dc3911e59ae9d85bba8bf027c8f16b12e55d0e Mon Sep 17 00:00:00 2001 From: leandro <leandroalmada86@gmail.com> Date: Mon, 23 Aug 2021 09:31:30 +0200 Subject: [PATCH] add function to get feature_type in store --- src/components/ImportTask.vue | 2 +- src/store/modules/feature_type.js | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/ImportTask.vue b/src/components/ImportTask.vue index 7214eb04..bc644619 100644 --- a/src/components/ImportTask.vue +++ b/src/components/ImportTask.vue @@ -3,7 +3,7 @@ <table class="ui collapsing celled table"> <thead> <tr> - <th>Fichier</th> + <th>Fichiers importés</th> <th>Status</th> </tr> </thead> diff --git a/src/store/modules/feature_type.js b/src/store/modules/feature_type.js index 3e12c3a1..b07e19a0 100644 --- a/src/store/modules/feature_type.js +++ b/src/store/modules/feature_type.js @@ -1,3 +1,7 @@ +import axios from "axios" +import store from '@/store'; + + const feature_type = { namespaced: true, state: { @@ -72,17 +76,17 @@ const feature_type = { const data = { form: state.form, formset: state.customForms } console.log("data", data) - /* axios - .post(`${DJANGO_API_BASE}feature_type/`, data) + axios + .post(`${process.env.VUE_APP_DJANGO_API_BASE}feature_type/`, data) .then((response) => { - const routerHistory = router.options.routerHistory - commit("SET_USER", response.data.user); - router.push(routerHistory[routerHistory.length - 1] || "/") - dispatch("GET_USER_LEVEL_PROJECTS"); + const routerHistory = this.$router.options.routerHistory + store.commit("SET_USER", response.data.user); + this.$router.push(routerHistory[routerHistory.length - 1] || "/") + store.dispatch("GET_USER_LEVEL_PROJECTS"); }) .catch(() => { - commit("SET_USER", false) - }); */ + store.commit("SET_USER", false) + }); }, }, -- GitLab