Conversation
…e-4-Community/ssf into sk/SSF-150-food-request-bugs
sam-schu
left a comment
There was a problem hiding this comment.
When I try to navigate to /request-form to test, I'm getting the error setSelectedItems is not defined
sam-schu
left a comment
There was a problem hiding this comment.
The selected food types still persist in the new request modal
| const [selectedFoodTypes, setSelectedFoodTypes] = useState<FoodType[]>([]); | ||
| const [requestedSize, setRequestedSize] = useState<string>(''); | ||
| const [additionalNotes, setAdditionalNotes] = useState<string>(''); | ||
| const [selectedItems, setSelectedItems] = useState<string[]>([]); // For potential future use if we want to allow item-level selection |
There was a problem hiding this comment.
We don't need to preemptively add this, if we decided to add this feature we could add in the state variable then
| setRequestedSize(''); | ||
| setAdditionalNotes(''); | ||
| } | ||
| setAlert({ isError: true, message: '' }); |
There was a problem hiding this comment.
This is causing success/failure alerts to immediately disappear - submitting a food request causes isOpen to change from true to false, which reruns the effect
There was a problem hiding this comment.
Also, for the alert we should now use the new floating alert component
There was a problem hiding this comment.
I believe this does already
ℹ️ Issue
Closes 150
📝 Description
Ensured the “New Request” modal always initializes with empty form fields
Ensured correct fields are filled out when opening 'Resubmit latest' and that additional info is empty if latest request was empty
Resets the error state to avoid stale state between modal openings
✔️ Verification
UI tested