From c41f07b1cf4cb50cf68cebae7cdccec4e88ac780 Mon Sep 17 00:00:00 2001
From: Janne Alatalo <janne.alatalo@jamk.fi>
Date: Wed, 26 Sep 2018 13:03:13 +0300
Subject: [PATCH] Add temporary fix for traffic flow cors problem

---
 src/utils/api-client.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/utils/api-client.js b/src/utils/api-client.js
index 120d3d7..869f3a2 100644
--- a/src/utils/api-client.js
+++ b/src/utils/api-client.js
@@ -28,8 +28,9 @@ export function get_lam_points(api_url, set_state) {
 }
 
 export function get_free_flow_speeds(api_url, set_state) {
-  return fetch(`${api_url}/api/v1/data/free-flow-speeds`)
-    .then((res) => res.json())
+  return fetch("/free-flow-speeds.json")
+    .then((res) => res.text())
+    .then((t) => JSON.parse(t))
     .then((json) => {
       const tms_data = json.tmsFreeFlowSpeeds;
       set_state((prevState) => {
-- 
GitLab