Skip to content
Snippets Groups Projects
Commit f1206284 authored by MrJoshE's avatar MrJoshE
Browse files

Added admin endpoint to fetch all parking locations

parent 1ca47e74
No related branches found
No related tags found
No related merge requests found
......@@ -15,16 +15,16 @@ app.use(cors());
const port = process.env.PORT;
const JWT_ALGORITHM = 'HS512';
// app.get('/location/parking-locations', async (request, response) => {
// try {
// const parkingLocations = await ParkingLocation.find({});
// console.log(`🤖: Successfully retrieved all ${parkingLocations.length} parking locations:`);
// response.send(parkingLocations);
// } catch (x) {
// console.error(x);
// response.status(500).send('⛔️ Server Error: An error has occured, please try again later');
// }
// });
app.get('/location/parking-locations-all', isAdmin, async (request, response) => {
try {
const parkingLocations = await ParkingLocation.find({});
// console.log(`🤖: Successfully retrieved all ${parkingLocations.length} parking locations:`);
response.send(parkingLocations);
} catch (x) {
console.error(x);
response.status(500).send('⛔️ Server Error: An error has occured, please try again later');
}
});
app.get('/location/parking-locations', async (request, response) => {
......
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