Files
adminka-frontend/src/features/admin/hooks/useOrganizationWallets.ts
2026-06-10 16:56:59 +03:00

13 lines
408 B
TypeScript

import { useQuery } from '@tanstack/react-query'
import { getOrganizationWallets } from '../api/adminApi'
export const WALLETS_QUERY_KEY = (orgId: string) => ['admin-wallets', orgId]
export function useOrganizationWallets(orgId: string | undefined) {
return useQuery({
queryKey: WALLETS_QUERY_KEY(orgId ?? ''),
queryFn: () => getOrganizationWallets(orgId as string),
enabled: !!orgId,
})
}