// Auto-generated by DjangoCFG - see CLAUDE.md
'use client';

/**
 * SWR Hooks for Totp
 *
 * React hooks powered by SWR for data fetching with automatic caching,
 * revalidation, and optimistic updates.
 *
 * Usage:
 * ```typescript
 * // Query hooks (GET)
 * const { data, error, isLoading } = useUsers({ page: 1 })
 *
 * // Mutation hooks (POST/PUT/PATCH/DELETE)
 * const createUser = useCreateUser()
 * await createUser({ name: 'John', email: 'john@example.com' })
 * ```
 */
import { useSWRConfig } from 'swr'
import * as Fetchers from '../fetchers/totp'
import type { API } from '../../index'

/**
 * API operation
 *
 * @method DELETE
 * @path /cfg/totp/devices/{id}/
 */
export function useDeleteTotpDevicesDestroy() {
  const { mutate } = useSWRConfig()

  return async (id: string, client?: API): Promise<void> => {
    const result = await Fetchers.deleteTotpDevicesDestroy(id, client)
    // Revalidate related queries
    mutate('cfg-totp-devices')
    mutate('cfg-totp-device')
    return result
  }
}


