Skip to content
Snippets Groups Projects
Commit 35db3aec authored by Timothee P's avatar Timothee P :sunflower:
Browse files

add call to action add_feature when features return from api

parent 1f5bd34b
No related branches found
No related tags found
No related merge requests found
......@@ -45,12 +45,13 @@ const feature = {
},
actions: {
GET_PROJECT_FEATURES({ commit }, project_slug) {
GET_PROJECT_FEATURES({ commit, dispatch }, project_slug) {
axios
.get(`${DJANGO_API_BASE}projects/${project_slug}/feature`)
.then((response) => {
const features = response.data.features;
commit("SET_FEATURES", features);
dispatch("map/ADD_FEATURES", null, { root: true });
})
.catch((error) => {
throw error;
......@@ -61,59 +62,59 @@ const feature = {
dispatch ("map/ADD_FEATURES");
}, */
// POST_FEATURE({ state }) {
/* const data = {
form: state.form,
attachmentFormset: state.attachmentFormset,
linkedFormset: state.linkedFormset,
extra_form: state.extra_form,
} */
// POST_FEATURE({ state }) {
/* const data = {
form: state.form,
attachmentFormset: state.attachmentFormset,
linkedFormset: state.linkedFormset,
extra_form: state.extra_form,
} */
/* axios
.post(`${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");
})
.catch(() => {
commit("SET_USER", false)
}); */
// },
/* axios
.post(`${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");
})
.catch(() => {
commit("SET_USER", false)
}); */
// },
//DELETE_FEATURE({ state }, feature_slug) {
//console.log("Deleting feature:", feature_slug, state)
//console.log("Deleting feature:", feature_slug, state)
/* axios
.post(`${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");
})
.catch(() => {
commit("SET_USER", false)
}); */
// },
// POST_COMMENT({ state }, data) {
//console.log("post comment", data, state)
/* axios
.post(`${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");
})
.catch(() => {
commit("SET_USER", false)
}); */
// },
// POST_COMMENT({ state }, data) {
//console.log("post comment", data, state)
/* axios
.post(`${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");
})
.catch(() => {
commit("SET_USER", false)
}); */
// },
// EXPORT_FEATURES({ /* state */ }) {
//console.log("Export features", state.features)
// }
/* axios
.post(`${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");
})
.catch(() => {
commit("SET_USER", false)
}); */
// },
// EXPORT_FEATURES({ /* state */ }) {
//console.log("Export features", state.features)
// }
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment