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

function getAttachement in feature_edit

parent c96c200d
No related branches found
No related tags found
No related merge requests found
......@@ -240,12 +240,11 @@ import { mapUtil } from "@/assets/js/map-util.js";
const axios = require("axios");
import flip from "@turf/flip";
axios.defaults.headers.common['X-CSRFToken'] = (name => {
var re = new RegExp(name + "=([^;]+)");
var value = re.exec(document.cookie);
return (value != null) ? unescape(value[1]) : null;
})('csrftoken');
axios.defaults.headers.common["X-CSRFToken"] = ((name) => {
var re = new RegExp(name + "=([^;]+)");
var value = re.exec(document.cookie);
return value != null ? unescape(value[1]) : null;
})("csrftoken");
export default {
name: "Feature_edit",
......@@ -836,6 +835,13 @@ export default {
this.erreurGeolocalisationMessage = "";
}
},
getFeatureAttachments() {
// todo : mutualize in store with feature_detail.vue
featureAPI
.getFeatureAttachments(this.$route.params.slug_signal)
.then((data) => this.addExistingAttachementFormset(data));
},
},
created() {
......@@ -847,11 +853,8 @@ export default {
this.$route.params.slug_type_signal
);
// todo : mutualize in store with feature_detail.vue
if (this.$route.params.slug_signal) {
featureAPI
.getFeatureAttachments(this.$route.params.slug_signal)
.then((data) => this.addExistingAttachementFormset(data));
this.getFeatureAttachments();
} else {
//* be sure that previous attachemntFormset has been cleared for creation
this.$store.commit("feature/CLEAR_ATTACHMENT_FORM");
......
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