changeset 5235:987a56071402 new-fwa

changed route parameter from objnam to bottleneck_id. changed route part from /fairway-depth/ to /fairway.
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 12 May 2020 14:42:26 +0200
parents 30a55f46996f
children b47a041e03c4
files client/src/store/fairwayavailability.js
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/store/fairwayavailability.js	Tue May 12 14:27:54 2020 +0200
+++ b/client/src/store/fairwayavailability.js	Tue May 12 14:42:26 2020 +0200
@@ -14,17 +14,18 @@
 
 /*eslint no-unused-vars: ["error", { "varsIgnorePattern": "_" }]*/
 
-import { HTTP } from "@/lib/http";
 import {
+  endOfMonth,
+  endOfQuarter,
+  endOfYear,
   format,
   startOfMonth,
-  endOfMonth,
-  startOfYear,
-  endOfYear,
   startOfQuarter,
-  endOfQuarter
+  startOfYear
 } from "date-fns";
 
+import { HTTP } from "@/lib/http";
+
 const LIMITINGFACTORS = {
   WIDTH: "width",
   DEPTH: "depth"
@@ -260,8 +261,8 @@
         } = options;
         let { from, to } = options;
         let name = feature.hasOwnProperty("properties")
-          ? feature.properties.name
-          : feature.get("objnam");
+          ? feature.properties.bottleneck_id
+          : feature.get("bottleneck_id");
         [from, to] = getIntervallBorders(from, to, frequency);
         let additionalParams = "";
         let endpoint = type;
@@ -275,7 +276,7 @@
         }
         const start = encodeURIComponent("00:00:00+00:00");
         const end = encodeURIComponent("23:59:59+00:00");
-        const URL = `data/${endpoint}/fairway-depth/${encodeURIComponent(
+        const URL = `data/${endpoint}/fairway/${encodeURIComponent(
           name
         )}?from=${from}T${start}&to=${to}T${end}&mode=${frequency}&los=${LOS}${additionalParams}`;
         HTTP.get(URL, {
@@ -305,8 +306,8 @@
         } = options;
         let { from, to } = options;
         let name = feature.hasOwnProperty("properties")
-          ? feature.properties.name
-          : feature.get("objnam");
+          ? feature.properties.bottleneck_id
+          : feature.get("bottleneck_id");
         [from, to] = getIntervallBorders(from, to, frequency);
         const start = encodeURIComponent("00:00:00+00:00");
         const end = encodeURIComponent("23:59:59+00:00");