Skip to content

Commit

Permalink
Remove unused elements
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperL1218 committed Dec 4, 2024
1 parent 8a02662 commit b89c450
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
17 changes: 4 additions & 13 deletions backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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}`,
});

Expand Down Expand Up @@ -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}`,
});

Expand Down Expand Up @@ -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
*
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/Apartment/MapModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ interface MapModalProps extends BaseProps {
aptName: string;
open: boolean;
onClose: () => void;
setOpen: Dispatch<SetStateAction<boolean>>;
}

/**
Expand Down Expand Up @@ -144,7 +143,6 @@ const MapModal = ({
aptName,
open,
onClose,
setOpen,
address,
latitude = 0,
longitude = 0,
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/pages/ApartmentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ export type RatingInfo = {
rating: number;
};

interface MapInfoRef {
recenter: () => void;
}

const useStyles = makeStyles((theme) => ({
reviewButton: {
borderRadius: '30px',
Expand Down Expand Up @@ -160,7 +156,6 @@ const ApartmentPage = ({ user, setUser }: Props): ReactElement => {
const saved = savedIcon;
const unsaved = unsavedIcon;
const [isSaved, setIsSaved] = useState(false);
const mapInfoRef = useRef<MapInfoRef>(null);
const [mapToggle, setMapToggle] = useState(false);

const dummyTravelTimes: LocationTravelTimes = {

Check warning on line 161 in frontend/src/pages/ApartmentPage.tsx

View workflow job for this annotation

GitHub Actions / lint

'dummyTravelTimes' is assigned a value but never used
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit b89c450

Please sign in to comment.