Skip to content

fix(teamProjects): Migrate api.request to useMutation#118038

Merged
ryan953 merged 1 commit into
masterfrom
seer/fix/team-projects-api-migration
Jun 20, 2026
Merged

fix(teamProjects): Migrate api.request to useMutation#118038
ryan953 merged 1 commit into
masterfrom
seer/fix/team-projects-api-migration

Conversation

@sentry

@sentry sentry Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor
This PR addresses the `no-callback-api-request` linter warning in `static/app/views/settings/organizationTeams/teamProjects.tsx`.

The handleLinkProject function was using the deprecated callback-style api.request for linking/unlinking projects. This has been migrated to use TanStack Query's useMutation hook, leveraging fetchMutation for the API call.

  • The api.request call has been replaced with a useMutation instance.
  • Success and error handling logic (refetching, ProjectsStore updates, and toast messages) have been moved into the onSuccess and onError callbacks of the mutation.
  • The useApi hook and the api instance are no longer needed in this component and have been removed.
  • Added the <Project> type argument to fetchMutation to ensure type safety for the response data passed to ProjectsStore.onUpdateSuccess.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes FRONTEND-TSC-31

@sentry sentry Bot requested a review from a team as a code owner June 18, 2026 17:41
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 18, 2026
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Jun 20, 2026
@ryan953 ryan953 merged commit 3aa9173 into master Jun 20, 2026
86 of 87 checks passed
@ryan953 ryan953 deleted the seer/fix/team-projects-api-migration branch June 20, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant