diff --git a/components/dashboard/src/data/auth-providers/delete-org-auth-provider-mutation.ts b/components/dashboard/src/data/auth-providers/delete-org-auth-provider-mutation.ts index 3d071b04c9aa0e..c4428ba3f51957 100644 --- a/components/dashboard/src/data/auth-providers/delete-org-auth-provider-mutation.ts +++ b/components/dashboard/src/data/auth-providers/delete-org-auth-provider-mutation.ts @@ -5,9 +5,10 @@ */ import { useMutation, useQueryClient } from "@tanstack/react-query"; -import { getGitpodService } from "../../service/service"; import { useCurrentOrg } from "../organizations/orgs-query"; import { getOrgAuthProvidersQueryKey, OrgAuthProvidersQueryResult } from "./org-auth-providers-query"; +import { authProviderClient } from "../../service/public-api"; +import { DeleteAuthProviderRequest } from "@gitpod/public-api/lib/gitpod/v1/authprovider_pb"; type DeleteAuthProviderArgs = { providerId: string; @@ -22,10 +23,13 @@ export const useDeleteOrgAuthProviderMutation = () => { throw new Error("No current organization selected"); } - return await getGitpodService().server.deleteOrgAuthProvider({ - id: providerId, - organizationId: organization.id, - }); + const response = await authProviderClient.deleteAuthProvider( + new DeleteAuthProviderRequest({ + authProviderId: providerId, + }), + ); + + return response; }, onSuccess: (_, { providerId }) => { if (!organization) {