Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/frontend/src/components/foodRequestManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const RequestManagement: React.FC<RequestManagementProps> = ({
}, [selectedFilteredPantries]);

useEffect(() => {
if (!initialRequestId || requests.length === 0) return;
if (initialRequestId === undefined || requests.length === 0) return;
const match = requests.find((r) => r.requestId === initialRequestId);

if (match) {
Expand All @@ -95,9 +95,10 @@ const RequestManagement: React.FC<RequestManagementProps> = ({
setCurrentPage(Math.floor(idx / itemsPerPage) + 1);
}
} else {
setAlertMessage('Request not found.', AlertStatus.ERROR);
navigate(location.pathname, { replace: true });
}
Comment on lines 97 to 100
}, [initialRequestId, requests, navigate, location]);
}, [initialRequestId, requests, navigate, location, setAlertMessage]);

const pantryOptions = [
...new Set(
Expand Down
3 changes: 2 additions & 1 deletion apps/frontend/src/containers/volunteerOrderManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ const VolunteerOrderManagement: React.FC = () => {
}
}
} else {
setAlertMessage('Order not found.', AlertStatus.ERROR);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look to see if the same copilot comment applies here

navigate(ROUTES.VOLUNTEER_ORDER_MANAGEMENT, { replace: true });
}
}, [searchParams, statusOrders, navigate]);
}, [searchParams, statusOrders, navigate, setAlertMessage]);

// Pre-fill pantry filter from url param, url is kept for back/forward navigation
useEffect(() => {
Expand Down
Loading