[SSF-213] Create new donation fixes#179
Conversation
dburkhart07
left a comment
There was a problem hiding this comment.
I'm noticing that the FloatingAlert component uses a status of info | error, whereas the AlertState interface uses success | error. We should standardize this (in my opinion, info | error everywhere). Can we change all the success alert messages to be info instead, create an enum in types to be reused in both the FloatingAlert and AlertState, make it so that all FloatingAlerts now just have status={alertState.status}?
… edit FM + pantry application details in a separate commit
|
To replace the [error, setError] useState pattern in I also noticed during testing that you can edit pantry/FM applications so that the values for certain fields aren't the right type (e.g. setting "Zip/Postal Code" to a string). We might want to set some restrictions around that. |
dburkhart07
left a comment
There was a problem hiding this comment.
lgtm pending decision on alert type
| ERROR = 'error', | ||
| } | ||
|
|
||
| export enum AlertType { |
There was a problem hiding this comment.
Regarding the usage of this AlertType, why do we need this? I think we can just rely on the actual message to differentiate what the error is, and remove the typing altogether. Lmk if you have any other thoughts
There was a problem hiding this comment.
Should I remove the alert type field altogether or just the enum?
There was a problem hiding this comment.
i think both, i dont really see a use case for this unless you do.
There was a problem hiding this comment.
For switching between icons (e.g. line 221 for FM application details), should I case on the error message then?
I didn't really wanna do string matching though, so lmk if you have a better idea on how to switch between the icons.
|
ok yea other than the frontend ui which is still waiting for FM to be merged otherwise everything else lgtm! |
jxuistrying
left a comment
There was a problem hiding this comment.
waiting for fm dashboard to be merged so lgtm!


ℹ️ Issue
Closes SSF-213
📝 Description
Backend:
POST /api/donationsendpoint so only Food Manufacturers can access itFrontend:
alerthook to include astatusfieldalerthookapps/frontend/src/containers/foodManufacturerDonationManagement.tsx✔️ Verification
createDonationendpointSucess:

Error:

🏕️ (Optional) Future Work / Notes
Edit: updated the backend test and now all tests pass
manufacturerIDis still necessary inapps/frontend/src/containers/donationManagement.tsx