Skip to content

Commit

Permalink
fix: remove unused hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Meriem-BM committed Oct 24, 2024
1 parent e904c7e commit 1daf4f1
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions app/comparison/utils/data-fetching/delegation.ts
Original file line number Diff line number Diff line change
@@ -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<DelegateStatusData> => {
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 });
};
Expand Down

0 comments on commit 1daf4f1

Please sign in to comment.