diff --git a/src/views/feature/Feature_edit.vue b/src/views/feature/Feature_edit.vue index 74ee78c9876f6ad982745bb98896903c34b607c4..bf455ac417517635948694ad077698dda856b37a 100644 --- a/src/views/feature/Feature_edit.vue +++ b/src/views/feature/Feature_edit.vue @@ -271,7 +271,6 @@ export default { data() { return { map: null, - feature_type: null, baseUrl: this.$store.state.configuration.BASE_URL, file: null, showGeoRef: false, @@ -336,6 +335,7 @@ export default { computed: { ...mapGetters(["project"]), + ...mapGetters("feature_type", ["feature_type"]), ...mapState(["user", "USER_LEVEL_PROJECTS"]), ...mapState("map", ["basemaps"]), ...mapState("feature", [ @@ -415,15 +415,6 @@ export default { }, }, - /* watch: { - feature(newValue) { - if (this.$route.name === "editer-signalement") { - this.initForm(); - this.initExtraForms(newValue); - } - }, - }, */ - methods: { initForm() { if (this.currentRouteName === "editer-signalement") { @@ -875,7 +866,7 @@ export default { }); const currentFeatureId = this.$route.params.slug_signal; - const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature/?feature_type__slug=${this.feature_type.slug}&output=geojson`; + const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature/?feature_type__slug=${this.$route.params.slug_type_signal}&output=geojson`; axios .get(url) .then((response) => { @@ -932,14 +923,6 @@ export default { }, created() { - //if (!this.project) { - //console.log(this.$store.state.projects); - /* this.project = this.$store.state.projects.find( - (project) => project.slug === this.$store.state.project_slug - ); */ - //this.filterStatusChoicesF(); - //} - this.$store.commit( "feature_type/SET_CURRENT_FEATURE_TYPE_SLUG", this.$route.params.slug_type_signal @@ -952,17 +935,12 @@ export default { }, mounted() { - let ftSlug = this.$route.params.slug_type_signal; this.$store .dispatch("GET_PROJECT_INFO", this.$route.params.slug) .then((data) => { console.log(data); this.initForm(); this.initMap(); - console.log(this.$store.state.feature_type.feature_types); - this.feature_type = this.$store.state.feature_type.feature_types.find( - (el) => el.slug === ftSlug - ); this.onFeatureTypeLoaded(); this.initExtraForms();