Add return grant button to grant cards (#175) #189
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the problem
Problem #175 - there is no button to return grants on the mobile app, this adds one.
Describe your changes
I've added a "Cancel Grant" button to each Grant Card. When clicked, it displays a warning message—just like the one on HCB Web—informing the user about the action they're about to take. The user can either cancel or confirm the action. If confirmed, the grant is canceled using the new HCB V4 API endpoint:
/api/v4/card_grants/:id/cancel
. A spinner appears on the button to provide feedback to the client and prevent duplicate API calls, and an error alert is shown if the API request fails.Checklist
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-05-25.at.12.27.55.mp4