From b89c450f550937a19d43cc89812ea872700f7f0f Mon Sep 17 00:00:00 2001 From: CasperL1218 Date: Tue, 3 Dec 2024 21:02:47 -0500 Subject: [PATCH] Remove unused elements --- backend/src/app.ts | 17 ++++------------- frontend/src/components/Apartment/MapModal.tsx | 2 -- frontend/src/pages/ApartmentPage.tsx | 6 ------ 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/backend/src/app.ts b/backend/src/app.ts index 26c2cca7..2c5b1ac8 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -984,15 +984,6 @@ app.post('/api/add-contact-question', authenticate, async (req, res) => { } }); -interface TravelTimes { - agQuadWalking: number; - agQuadDriving: number; - engQuadWalking: number; - engQuadDriving: number; - hoPlazaWalking: number; - hoPlazaDriving: number; -} - const { REACT_APP_MAPS_API_KEY } = process.env; const LANDMARKS = { eng_quad: '42.4445,-76.4836', // Duffield Hall @@ -1072,7 +1063,7 @@ app.post('/api/calculate-travel-times', async (req, res) => { console.log('Raw walking times:', walkingTimes); console.log('Raw driving times:', drivingTimes); - const travelTimes: TravelTimes = { + const travelTimes: LocationTravelTimes = { engQuadWalking: walkingTimes[0], engQuadDriving: drivingTimes[0], agQuadWalking: walkingTimes[1], @@ -1117,7 +1108,7 @@ app.post('/api/test-travel-times/:buildingId', async (req, res) => { } // Calculate travel times using the main endpoint - const response = await axios.post(`http://localhost:3000/api/calculate-travel-times`, { + const response = await axios.post(`/api/calculate-travel-times`, { origin: `${buildingData.latitude},${buildingData.longitude}`, }); @@ -1183,7 +1174,7 @@ app.post('/api/batch-create-travel-times/:batchSize/:startAfter?', async (req, r return; } - const response = await axios.post(`http://localhost:3000/api/calculate-travel-times`, { + const response = await axios.post(`/api/calculate-travel-times`, { origin: `${buildingData.latitude},${buildingData.longitude}`, }); @@ -1221,7 +1212,7 @@ app.post('/api/batch-create-travel-times/:batchSize/:startAfter?', async (req, r * Looks up the travel times document for the given building ID and returns the stored walking and driving * times to Cornell landmarks: Engineering Quad, Agriculture Quad, and Ho Plaza. * - * @route GET /api/travel-times/:buildingId + * @route GET /api/travel-times-by-id/:buildingId * * @input {string} req.params.buildingId - ID of the building to get travel times for * diff --git a/frontend/src/components/Apartment/MapModal.tsx b/frontend/src/components/Apartment/MapModal.tsx index 1fadf907..0b3ed270 100644 --- a/frontend/src/components/Apartment/MapModal.tsx +++ b/frontend/src/components/Apartment/MapModal.tsx @@ -116,7 +116,6 @@ interface MapModalProps extends BaseProps { aptName: string; open: boolean; onClose: () => void; - setOpen: Dispatch>; } /** @@ -144,7 +143,6 @@ const MapModal = ({ aptName, open, onClose, - setOpen, address, latitude = 0, longitude = 0, diff --git a/frontend/src/pages/ApartmentPage.tsx b/frontend/src/pages/ApartmentPage.tsx index 443c89b8..26f0ec40 100644 --- a/frontend/src/pages/ApartmentPage.tsx +++ b/frontend/src/pages/ApartmentPage.tsx @@ -56,10 +56,6 @@ export type RatingInfo = { rating: number; }; -interface MapInfoRef { - recenter: () => void; -} - const useStyles = makeStyles((theme) => ({ reviewButton: { borderRadius: '30px', @@ -160,7 +156,6 @@ const ApartmentPage = ({ user, setUser }: Props): ReactElement => { const saved = savedIcon; const unsaved = unsavedIcon; const [isSaved, setIsSaved] = useState(false); - const mapInfoRef = useRef(null); const [mapToggle, setMapToggle] = useState(false); const dummyTravelTimes: LocationTravelTimes = { @@ -445,7 +440,6 @@ const ApartmentPage = ({ user, setUser }: Props): ReactElement => { aptName={apt!.name} open={mapOpen} onClose={handleMapModalClose} - setOpen={setMapOpen} address={apt!.address} longitude={apt!.longitude} latitude={apt!.latitude}