feat(transfers): wire transfers page to real API with shared UI - #1374
Merged
yusuftomilola merged 1 commit intoAug 26, 2026
Merged
Conversation
…nents - Add lib/api/transfers.ts with typed API client for all transfer endpoints - Add useTransfers, useApproveTransfer, useRejectTransfer, useCancelTransfer hooks - Add transfers query keys to centralized keys registry - Replace hardcoded MOCK_TRANSFERS with React Query data fetching - Wire Approve/Reject buttons to real backend calls with mutation state - Replace inline-styled markup with shared Badge component - Remove 'my-requests' tab (was only filtering by hardcoded current user) Closes DistinctCodes#1293
|
@develyn is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@DeEvelyn 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! 🚀 |
yusuftomilola
approved these changes
Aug 26, 2026
yusuftomilola
left a comment
Collaborator
There was a problem hiding this comment.
No merge conflicts with main. Wiring transfers page to the real API with shared UI looks solid - approving.
Closed
6 tasks
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.
Summary
Closes #1293
Closes #1292
Closes #1295
Closes #1294
Replaces the hardcoded
MOCK_TRANSFERSarray in the transfers page with real backend data via React Query, wires the Approve/Reject buttons to actual API calls, and swaps inline-styled markup for the sharedBadgecomponent.Why
The transfers page was the only data page in the dashboard rendering a hardcoded mock array — it never called the real
/transfersAPI. The Approve/Reject buttons had noonClickhandlers, so clicking them did nothing. The page also used raw inlinestyle={{...}}objects instead of the sharedBadgecomponent used everywhere else. This made the page non-functional and visually inconsistent with the rest of the app.What was built
frontend/lib/api/transfers.ts:TransferStatusenumTransferStatusfor type-safe filteringAssetTransferinterfaceTransferListResponse/TransferListFilterstransferApiClientgetTransfers,getTransfer,approveTransfer,rejectTransfer,cancelTransfer,completeTransferfrontend/lib/query/hooks/useTransfers.ts:useTransfers(filters)GET /transferswith paginationuseTransfer(id)useApproveTransfer()transfers.allon successuseRejectTransfer(){ id, data: { reason } }inputuseCancelTransfer()transfers.allon successfrontend/lib/query/keys.ts— Addedtransferskey namespace withall,lists,list(filters), anddetail(id).frontend/app/(dashboard)/transfers/page.tsx:useTransfers()replacesMOCK_TRANSFERSstateapproveMutation.mutate(id)with loading stateConfirmDialog; callsrejectMutation.mutate()with reasonBadgecomponent instead of rawspanwith inline stylesMOCK_TRANSFERSarray,my-requeststab (was filtering by hardcoded"u1")Integration changes outside
transfers/frontend/lib/query/keys.ts— Addedtransfersquery-key namespace. No existing keys modified.frontend/lib/api/transfers.ts— New file, no existing files modified.frontend/lib/query/hooks/useTransfers.ts— New file, no existing files modified.No existing files modified beyond
keys.tsand the page itself, so regression risk is low.Acceptance criteria coverage
useTransfers()hook replacesMOCK_TRANSFERS)approveMutation/rejectMutationwithonSuccessinvalidation)Badgereplaces inline-styledspan)Test plan
npm run buildinfrontend/— succeeds (no new type errors)npm test— not run per instructionEnv vars / Notes
No new environment variables. The page depends on the existing
apiaxios instance configured infrontend/lib/api.ts, which must point to a backend with the/transfersendpoints available.