diff --git a/app/comparison/utils/data-fetching/delegation.ts b/app/comparison/utils/data-fetching/delegation.ts index 71e3358..ff30aa5 100644 --- a/app/comparison/utils/data-fetching/delegation.ts +++ b/app/comparison/utils/data-fetching/delegation.ts @@ -1,43 +1,6 @@ -import { useMutation, useQuery } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import { axiosInstance } from '@/app/utils/axiosInstance'; -type CollectionMetadata = { - readonly username: string - readonly profileUrl: string -}; - -type Budget = { - readonly metadata: CollectionMetadata -}; - -type Collection = { - readonly collectionId: number - readonly metadata: CollectionMetadata -}; - -interface DelegateStatusData { - fromYou: { - budget: Budget - collections: Collection[] - } - toYou?: { - budget: Budget[] - collections: Collection[] - } -} - -export const getDelegations = async (): Promise => { - const res = await axiosInstance.get('flow/delegate/status'); - return res.data; -}; - -export const useGetDelegations = () => { - return useQuery({ - queryKey: ['delegations'], - queryFn: () => getDelegations(), - }); -}; - export const revokeDelegation = async (collectionId: number) => { await axiosInstance.post('flow/delegate/revoke', { collectionId }); };