feat: implement useAdoptionApprovals hook with polling and MSW handlers#357
Open
aboyejirebecca-prog wants to merge 6 commits into
Open
feat: implement useAdoptionApprovals hook with polling and MSW handlers#357aboyejirebecca-prog wants to merge 6 commits into
aboyejirebecca-prog wants to merge 6 commits into
Conversation
- Replace stub useAdoptionApprovals with a useApiQuery-based implementation
- Fetch GET /adoption/:id/approvals and return { required, given, pending,
quorumMet, escrowAccountId, isLoading, isError }
- Poll every 30s via refetchInterval; stops automatically once quorumMet is true
- Add AdoptionApprovalsResponse type to adoption.ts
- Update adoptionService.getApprovals return type to AdoptionApprovalsResponse
- Update ApprovalHistoryTab to consume the new response shape (data.given)
- Update MSW approval handler with pre-quorum and post-quorum fixture shapes
- Remove duplicate GET /adoption/:id/approvals stub from adoption handlers
- Add unit tests: pre-quorum state, post-quorum state, polling stops on quorum
Closes amina69#174
|
@aboyejirebecca-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
Ready for review! All tests pass. Happy to make changes if needed. |
…useAdoptionApprovals hook - Add missing properties to useAdoptionApprovals hook return type: - hasDecided: Check if current user already made a decision - requiredRoles: Array of roles needed to approve (currently empty) - mutateApprovalDecision: Function to submit approval/rejection - isPending: Loading state from mutation - setQuorumMet: State setter for testing quorum conditions - Integrate useMutateApprovalDecision hook for approval mutations - Update test mocks to include all required properties - Fix operator precedence issue with || and ?? operators - Remove unused imports and parameters
…useAdoptionApprovals hook - Add missing properties to useAdoptionApprovals hook return type: - hasDecided: Check if current user already made a decision - requiredRoles: Array of roles needed to approve (currently empty) - mutateApprovalDecision: Function to submit approval/rejection - isPending: Loading state from mutation - setQuorumMet: State setter for testing quorum conditions - Integrate useMutateApprovalDecision hook for approval mutations - Update test mocks to include all required properties - Fix operator precedence issue with || and ?? operators - Remove unused imports and parameters
Owner
|
@aboyejirebecca-prog your ci is failing |
…st and mock lucide-react in InlineError test
…requiredRoles, mutateApprovalDecision, isPending, setQuorumMet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #174