diff client/src/store/bottlenecks.js @ 5574:271888ef85bc surveysperbottleneckid

Finalize use of bottleneck id instead of name. Main feaure is the restructuring of the /surveys endpoint. The endpoint now takes queryparameters as qualifiers. /surveys?id={id} returns surveys to a given bottleck {id} /surveys?name={name} & date={date} returns surveys for given {name} of a bottleneck and {date} for a surveydate. This is needed mainly because there is some backwards incompatibility when reviewing sounding results where the summary of a sr import contains only the name instead of the id of the according bottleneck. To bridge this mismatch the survey endpoint could be queried for the sr to review given the surveydate and the name of the bottleneck. Premise is here, that a date and a bottleneck's name is specific enough to identify the correct survey with the correct bottleneck.
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 21 Jul 2021 14:33:35 +0200
parents 3b842e951317
children 973c71c07bb2
line wrap: on
line diff
--- a/client/src/store/bottlenecks.js	Tue Jul 20 18:56:18 2021 +0200
+++ b/client/src/store/bottlenecks.js	Wed Jul 21 14:33:35 2021 +0200
@@ -114,7 +114,7 @@
         commit("setSelectedBottleneck", id);
         if (id) {
           commit("surveysLoading", true);
-          HTTP.get("/surveys/" + encodeURIComponent(id), {
+          HTTP.get("/surveys?id=" + encodeURIComponent(id), {
             headers: {
               "X-Gemma-Auth": localStorage.getItem("token"),
               "Content-type": "text/xml; charset=UTF-8"