diff --git a/src/main/webapp/templates/forecastConfigurationForm.ftl b/src/main/webapp/templates/forecastConfigurationForm.ftl index 7d73b049f23a91d72c9b018717c69dde15756710..56c50f57ff3d3d1d5822aba263a70b2ed8405a05 100755 --- a/src/main/webapp/templates/forecastConfigurationForm.ftl +++ b/src/main/webapp/templates/forecastConfigurationForm.ftl @@ -174,14 +174,15 @@ function callbackOnCloseLocationMap(poiData) { if(!poiData.pointOfInterestId) { - persistNewLocation(poiData); + persistNewLocation(poiData, handleLocationChanged); } else { selectPoi(selectLocationElement, poiData.pointOfInterestId); + handleLocationChanged(); } - handleLocationChanged(); + } - function persistNewLocation(poiData) { + function persistNewLocation(poiData, callback) { fetch("/rest/poi", { method: 'POST', headers: { @@ -197,7 +198,8 @@ renderPoiSelect(selectLocationElement, locationList, poi.pointOfInterestId); // Assuming that this is not a weather station, since weather stations cannot be created using the // map, the user must have created a .... MAYBE HANDLED AUTOMATICALLY?? by the change event?? - console.info("Point of interest successfully persisted", poi); + //console.info("Point of interest successfully persisted", poi); + callback(); }) .catch(error => { console.error("Unable to persist new point of interest", error);