Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

715 B
Raw Blame
/*
 * Copyright 2025 Daytona Platforms Inc.
 * Modified by BoxLite AI, 2025-2026
 * SPDX-License-Identifier: AGPL-3.0
 */

import { useMutation, useQueryClient } from '@tanstack/react-query'
import { queryKeys } from '../queries/queryKeys'
import { useApi } from '../useApi'

interface UnlinkAccountParams {
  provider: string
  userId: string
}

export const useUnlinkAccountMutation = () => {
  const { userApi } = useApi()
  const queryClient = useQueryClient()

  return useMutation({
    mutationFn: ({ provider, userId }: UnlinkAccountParams) => userApi.unlinkAccount(provider, userId),
    onSuccess: () => {
      queryClient.invalidateQueries({ queryKey: queryKeys.user.accountProviders() })
    },
  })
}