changeset 5589:f24c9a7b3e82 surveysperbottleneckid

Remove request to determine bottleneckid. ID is given in summary.
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 05 Apr 2022 12:18:17 +0200
parents 94ef43fac0eb
children 826e67e959c9
files client/src/components/importoverview/SoundingResultDetail.vue
diffstat 1 files changed, 4 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/importoverview/SoundingResultDetail.vue	Tue Apr 05 10:15:37 2022 +0200
+++ b/client/src/components/importoverview/SoundingResultDetail.vue	Tue Apr 05 12:18:17 2022 +0200
@@ -57,36 +57,10 @@
         zoom: 17,
         preventZoomOut: true
       });
-      HTTP.get(
-        "/surveys?name=" +
-          encodeURIComponent(bottleneck) +
-          "&date=" +
-          encodeURIComponent(date),
-        {
-          headers: {
-            "X-Gemma-Auth": localStorage.getItem("token"),
-            "Content-type": "text/xml; charset=UTF-8"
-          }
-        }
-      )
-        .then(response => {
-          const { bottleneck_id } = response.data.surveys[0];
-          this.$store
-            .dispatch("bottlenecks/setSelectedBottleneck", bottleneck_id)
-            .then(() => {
-              this.$store.commit("bottlenecks/setSelectedSurveyByDate", date);
-            });
-        })
-        .catch(error => {
-          let message = "Backend not reachable";
-          if (error.response) {
-            const { status, data } = error.response;
-            message = `${status}: ${data.message || data}`;
-          }
-          displayError({
-            title: this.$gettext("Backend Error"),
-            message: message
-          });
+      this.$store
+        .dispatch("bottlenecks/setSelectedBottleneck", bottleneck)
+        .then(() => {
+          this.$store.commit("bottlenecks/setSelectedSurveyByDate", date);
         });
     }
   }