From f21a080854ec7c2bb0d3b0536efcf18a7f0774c7 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Fri, 29 Nov 2024 13:27:15 +0100
Subject: [PATCH] fix: Add location property to newly persisted POI to make KM
 distance to weatherstation work

---
 src/main/webapp/templates/forecastConfigurationForm.ftl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/webapp/templates/forecastConfigurationForm.ftl b/src/main/webapp/templates/forecastConfigurationForm.ftl
index 56c50f57..22f2da3b 100755
--- a/src/main/webapp/templates/forecastConfigurationForm.ftl
+++ b/src/main/webapp/templates/forecastConfigurationForm.ftl
@@ -194,6 +194,7 @@
             })
                 .then(response => response.json())
                 .then(poi => {
+                    poi.location=[poi.longitude, poi.latitude];
                     locationList.push(poi);
                     renderPoiSelect(selectLocationElement, locationList, poi.pointOfInterestId);
                     // Assuming that this is not a weather station, since weather stations cannot be created using the
-- 
GitLab