Skip to content

Conversation

@rohilsurana
Copy link
Member

Replace REST API call with Connect RPC + TanStack Query in the admin organization KYC edit form.

Changes

  • Replace api.adminServiceSetOrganizationKyc() with useMutation(AdminServiceQueries.setOrganizationKyc)
  • Add runtime validation using create() with SetOrganizationKycRequestSchema
  • Use onError callback for error handling instead of useEffect
  • Add query invalidation for organization KYC data
  • Update context state for immediate UI updates (temporary until context uses useQuery)
  • Use isSubmitting from react-hook-form for button loading state
  • Maintain existing form validation and UI behavior

@vercel
Copy link

vercel bot commented Oct 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
frontier Ready Ready Preview Comment Oct 29, 2025 10:01am

@rohilsurana rohilsurana requested a review from Copilot October 28, 2025 13:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the admin organization KYC form from REST API to ConnectRPC with TanStack Query, improving data synchronization and error handling patterns.

Key changes:

  • Replaced REST API call with ConnectRPC mutation using useMutation and AdminServiceQueries.setOrganizationKyc
  • Added runtime validation with create() and SetOrganizationKycRequestSchema
  • Moved error handling from try-catch to onError callback with query invalidation in onSuccess

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link

coveralls commented Oct 28, 2025

Pull Request Test Coverage Report for Build 18904010776

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 37.033%

Totals Coverage Status
Change from base Build 18901988022: 0.0%
Covered Lines: 14791
Relevant Lines: 39940

💛 - Coveralls

@rohilsurana rohilsurana force-pushed the migrate-admin-org-kyc-connectrpc branch from 223640b to 667b31b Compare October 29, 2025 10:00
@rohilsurana rohilsurana marked this pull request as draft October 30, 2025 06:04
@rohilsurana rohilsurana marked this pull request as ready for review October 30, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants