From 3336165ef20a37e846c914348b1dfcb30c7fb1d0 Mon Sep 17 00:00:00 2001
From: Marcus Tonge <mt01158@surrey.ac.uk>
Date: Sat, 22 Apr 2023 11:50:50 +0100
Subject: [PATCH] Updated admin page locations list

---
 src/pages/admin/admin.js | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/pages/admin/admin.js b/src/pages/admin/admin.js
index 3f0240d..704b4b3 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>
-- 
GitLab