Skip to content

refactor(frontend): remove custom API client and use autogenerated @/client services#2244

Merged
daryllimyt merged 1 commit intomainfrom
codex/refactor-services.custom.ts-to-use-generated-files
Mar 3, 2026
Merged

refactor(frontend): remove custom API client and use autogenerated @/client services#2244
daryllimyt merged 1 commit intomainfrom
codex/refactor-services.custom.ts-to-use-generated-files

Conversation

@daryllimyt
Copy link
Contributor

@daryllimyt daryllimyt commented Mar 3, 2026

Motivation

  • The handwritten services.custom.ts duplicated endpoints/types already present in the generated client, creating maintenance burden and drift.

Description

  • Delete the redundant frontend/src/client/services.custom.ts file and switch consumers to the autogenerated client surface from @/client.
  • Replace adminDeleteOrganizationWithConfirmation with the generated adminDeleteOrganization (which accepts confirm) in frontend/src/hooks/use-admin.ts.
  • Replace usages of CustomOAuthProviderCreateRequest with the generated CustomOAuthProviderCreate type and import providersCreateCustomProvider, triggersCreateCaseTrigger, and triggersGetCaseTrigger from @/client in frontend/src/lib/hooks.tsx.
  • Update imports and call sites in use-admin and shared hooks to consume generated types/functions instead of the deleted custom module.

Testing

  • Ran pnpm -C frontend check (Biome/format+lint) which completed and fixed one file successfully.
  • Ran pnpm -C frontend run typecheck (TypeScript tsc --noEmit) which completed successfully with no type errors.

Codex Task


Summary by cubic

Refactored the frontend to remove the custom API client and use the autogenerated "@/client" services. This reduces duplication and prevents type/endpoint drift.

  • Refactors
    • Deleted frontend/src/client/services.custom.ts.
    • Replaced adminDeleteOrganizationWithConfirmation with adminDeleteOrganization (uses confirm).
    • Switched CustomOAuthProviderCreateRequest to CustomOAuthProviderCreate and moved providers/triggers imports to "@/client".
    • Updated use-admin and shared hooks to consume generated types/functions, including adminListOrgTiers.

Written for commit c1e63fc. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@daryllimyt daryllimyt merged commit e22729c into main Mar 3, 2026
12 checks passed
@daryllimyt daryllimyt deleted the codex/refactor-services.custom.ts-to-use-generated-files branch March 3, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant