From fff4cc9a49b3f15d3a91872e3e14a4c36938220a Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sat, 7 Sep 2024 23:45:53 +1200 Subject: [PATCH] use axios instead of fetch --- src/public/index.html | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/public/index.html b/src/public/index.html index a2a7042..1fd53ff 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -3697,11 +3697,10 @@ clearMap(); // fetch nodes - await fetch('/api/v1/nodes').then(async (response) => { + await window.axios.get('/api/v1/nodes').then(async (response) => { // update nodes - var json = await response.json(); - onNodesUpdated(json.nodes); + onNodesUpdated(response.data.nodes); // hide loading setLoading(false); @@ -3722,12 +3721,8 @@ }); // fetch waypoints (after awaiting nodes, so we can use nodes cache in waypoint tooltips) - await fetch('/api/v1/waypoints').then(async (response) => { - - // update waypoints - var json = await response.json(); - onWaypointsUpdated(json.waypoints); - + await window.axios.get('/api/v1/waypoints').then(async (response) => { + onWaypointsUpdated(response.data.waypoints); }); }