From 5430d3fd6c5299afe71c0f83e4569b08b25be8b3 Mon Sep 17 00:00:00 2001
From: leandro <leandroalmada86@gmail.com>
Date: Thu, 7 Oct 2021 10:26:21 +0200
Subject: [PATCH] fix params to DELETE a feature

---
 src/store/modules/feature.js         | 4 +++-
 src/views/feature/Feature_detail.vue | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/store/modules/feature.js b/src/store/modules/feature.js
index 02c88915..4bb15cb9 100644
--- a/src/store/modules/feature.js
+++ b/src/store/modules/feature.js
@@ -195,7 +195,9 @@ const feature = {
 
     DELETE_FEATURE({ state, rootState }, feature_id) {
       console.log("Deleting feature:", feature_id, state)
-      const url = `${rootState.configuration.VUE_APP_DJANGO_API_BASE}features/${feature_id}`;
+      const url = `${rootState.configuration.VUE_APP_DJANGO_API_BASE}features/${feature_id}/?` +
+      `feature_type__slug=${rootState.feature_type.current_feature_type_slug}` + 
+      `&project__slug=${rootState.project_slug}`;
       return axios
         .delete(url)
         .then((response) => response)
diff --git a/src/views/feature/Feature_detail.vue b/src/views/feature/Feature_detail.vue
index 1a1dd773..62203ff9 100644
--- a/src/views/feature/Feature_detail.vue
+++ b/src/views/feature/Feature_detail.vue
@@ -533,7 +533,7 @@ export default {
         .dispatch("feature/DELETE_FEATURE", this.feature.feature_id)
         .then((response) => {
           if (response.status === 204) {
-            this.$store.dispatch("feature/GET_PROJECT_FEATURES");
+            this.$store.dispatch("feature/GET_PROJECT_FEATURES", this.$route.params.slug);
             this.goBackToProject();
           }
         });
-- 
GitLab