-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Description: Now that the expanded view is set up (shoutout Josie!), we want to add in the delete functionality, with the route Camila built in #189. The goal of this ticket is to add the button into the bottom of the expanded view, as shown in the design below, which causes an "are you sure" modal to pop up; that modal then calls the delete backend route, then re-calls the getAllGrantsroute to re-fetch updated version for store.
Design:
Success Critera:
- Delete button is created and added to the expanded grant view
- Button causes a modal to pop up (UPDATE: DESIGN IS IN FIGMA! THIS COMPONENT SHOULD TAKE IN PROPS, SINCE THIS COMPONENT WILL ALSO BE THE MODAL THAT POPS UP WHEN AN ADMIN TRIES TO DELETE A USER OR CHANGE A USER'S ROLE. you can call it something like
areYouSureModal.tsxor something like that)-
- the "yes" button in that modal is connected to the backend and calls the
deleteGrantroute, and then will also trigger the useEffect after deleting the grant in the store using what is returned from the backend - the "no" button just closes the modal and causes no other changes.
- HOW TO ABSTRACT IT: Pass in a button, pass in text
-
- After user confirms deleting, the
getAllGrantsroute is called to update the store, and the changes are reflected immediately in the frontend- e.g. if a grant is deleted, the grant is no longer displayed
Metadata
Metadata
Assignees
Labels
No labels