diff --git a/src/pages/admin/admin.js b/src/pages/admin/admin.js index 3f0240d3a64861487ef5fd8eee3f7d3120f89179..704b4b33ded5d6de8177f4e3d41037cbf2696ac5 100644 --- a/src/pages/admin/admin.js +++ b/src/pages/admin/admin.js @@ -103,7 +103,7 @@ const AdminPageView = () => { const addLocation = async (location) => { const { Title, Description, city, street_address, postcode, - lat, lon, total_spaces} = location; + lat, lon, total_spaces } = location; console.log(JSON.stringify({ Title: Title, @@ -115,7 +115,7 @@ const AdminPageView = () => { lon: lon, total_spaces: total_spaces, spaces_available: total_spaces, - })); + })); const baseUrl = process.env.REACT_APP_LOCATION_SERVICE_ENDPOINT; @@ -126,7 +126,15 @@ const AdminPageView = () => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, body: JSON.stringify({ - ...location + Title: Title, + Description: Description, + city: city, + street_address: street_address, + postcode: postcode, + lat: lat, + lon: lon, + total_spaces: total_spaces, + spaces_available: total_spaces, }), }); if (!response.ok) { @@ -248,12 +256,6 @@ const AdminPageView = () => { <Text flex="1"> <strong>Postcode:</strong> {location.postcode} </Text> - <Text flex="1"> - <strong>Longitude:</strong> {location.lon} - </Text> - <Text flex="1"> - <strong>Latitude:</strong> {location.lat} - </Text> <Text flex="1"> <strong>Total Spaces:</strong> {location.total_spaces} </Text>