Skip to content
Snippets Groups Projects
Commit 3336165e authored by Tonge, Marcus A (UG - Comp Sci & Elec Eng)'s avatar Tonge, Marcus A (UG - Comp Sci & Elec Eng)
Browse files

Updated admin page locations list

parent 05c5e6a8
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment