Skip to content
Snippets Groups Projects
Commit fb250f52 authored by DESPRES Damien's avatar DESPRES Damien
Browse files

fix bug utilisation state

parent b9f36cd9
No related branches found
No related tags found
3 merge requests!3add export-geojson & fix slug vs title in feature_list route,!2add extra_form to feature_edit,!1format date for derniers signalements, detect click outside menu dropdown and...
......@@ -48,7 +48,7 @@ const feature = {
actions: {
GET_PROJECT_FEATURES({ commit, /* dispatch */ }, project_slug) {
axios
.get(`${this.rootState.configuration.VUE_APP_DJANGO_API_BASE}projects/${project_slug}/feature/`)
.get(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${project_slug}/feature/`)
.then((response) => {
const features = response.data.features;
commit("SET_FEATURES", features);
......
......
......@@ -67,7 +67,7 @@ const feature_type = {
actions: {
GET_PROJECT_FEATURE_TYPES({ commit }, project_slug) {
axios
.get(`${this.rootState.configuration.VUE_APP_DJANGO_API_BASE}projects/${project_slug}/feature-types/`)
.get(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${project_slug}/feature-types/`)
.then((response) => commit("SET_FEATURE_TYPES", response.data.feature_types))
.catch((error) => {
throw error;
......@@ -95,7 +95,7 @@ const feature_type = {
if (requestType === "post") {
return axios
.post(`${this.rootState.configuration.VUE_APP_DJANGO_API_BASE}feature-types/`, data)
.post(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}feature-types/`, data)
.then((response) => {
if (response) {
const feature_type_slug = response.data.slug;
......@@ -108,7 +108,7 @@ const feature_type = {
});
} else if (requestType === "put") {
return axios
.put(`${this.rootState.configuration.VUE_APP_DJANGO_API_BASE}feature-types/${getters.feature_type.slug}/`, data)
.put(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}feature-types/${getters.feature_type.slug}/`, data)
.then((response) => {
if (response) {
const feature_type_slug = response.data.slug;
......@@ -130,7 +130,7 @@ const feature_type = {
formData.append("json_file", state.fileToImport);
formData.append("feature_type_slug", feature_type_slug);
let url =
this.rootState.configuration.VUE_APP_DJANGO_API_BASE +
this.state.configuration.VUE_APP_DJANGO_API_BASE +
'import-tasks/'
return axios
.post(url, formData, {
......@@ -152,7 +152,7 @@ const feature_type = {
GET_IMPORTS({ commit }, feature_type) {
let url =
this.rootState.configuration.VUE_APP_DJANGO_API_BASE +
this.state.configuration.VUE_APP_DJANGO_API_BASE +
"import-tasks?feature_type_slug=" +
feature_type;
axios
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment