diff client/src/components/Bottlenecks.vue @ 5572:3b842e951317 surveysperbottleneckid

change use from name of bottleneck to its id.
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 20 Jul 2021 17:07:51 +0200
parents 2ad3a29e0e14
children 271888ef85bc
line wrap: on
line diff
--- a/client/src/components/Bottlenecks.vue	Tue Jul 20 11:50:17 2021 +0200
+++ b/client/src/components/Bottlenecks.vue	Tue Jul 20 17:07:51 2021 +0200
@@ -138,7 +138,7 @@
       this.$store
         .dispatch(
           "bottlenecks/setSelectedBottleneck",
-          bottleneck.properties.name
+          bottleneck.properties.bottleneck_id
         )
         .then(() => {
           this.$store.commit("bottlenecks/selectedSurvey", survey);
@@ -155,7 +155,7 @@
       this.$store
         .dispatch(
           "bottlenecks/setSelectedBottleneck",
-          bottleneck.properties.name
+          bottleneck.properties.bottleneck_id
         )
         .then(() => {
           this.$store.dispatch("map/moveToFeauture", {
@@ -175,12 +175,15 @@
         this.openBottleneckSurveys = null;
       } else {
         this.loading = bottleneck;
-        HTTP.get("/surveys/" + encodeURIComponent(bottleneck.properties.name), {
-          headers: {
-            "X-Gemma-Auth": localStorage.getItem("token"),
-            "Content-type": "text/xml; charset=UTF-8"
+        HTTP.get(
+          "/surveys/" + encodeURIComponent(bottleneck.properties.bottleneck_id),
+          {
+            headers: {
+              "X-Gemma-Auth": localStorage.getItem("token"),
+              "Content-type": "text/xml; charset=UTF-8"
+            }
           }
-        })
+        )
           .then(response => {
             this.openBottleneckSurveys = response.data.surveys.sort((a, b) => {
               return a.date_info < b.date_info ? 1 : -1;