Skip to content
Snippets Groups Projects
Commit d5385d07 authored by Lukas's avatar Lukas
Browse files

Update useVestingDelegations to return outgoing and incoming delegations

parent dd16a633
No related branches found
No related tags found
1 merge request!585Lbudginas/#318 add hp incoming delegation account page
......@@ -13,23 +13,16 @@ const useVestingDelegations = (
data: vestingDelegationsData,
isLoading: isVestingDelegationsLoading,
isError: isVestingDelegationsError,
}: UseQueryResult<Hive.VestingDelegations[]> = useQuery({
}: UseQueryResult<Hive.TwoDirectionDelegations> = useQuery({
queryKey: ["vestingDelegations", delegatorAccount, liveDataEnabled],
queryFn: () => fetchingService.getVestingDelegations(delegatorAccount),
enabled: !!delegatorAccount,
select: (data) => {
const sortedData = data.sort(
(a: Hive.VestingDelegations, b: Hive.VestingDelegations) =>
a.delegatee.toLowerCase().localeCompare(b.delegatee.toLowerCase())
);
return sortedData;
},
refetchOnWindowFocus: false,
});
return {
vestingDelegationsData,
outgoingDelegations: vestingDelegationsData?.outgoing_delegations,
incomingDelegations: vestingDelegationsData?.incoming_delegations,
isVestingDelegationsLoading,
isVestingDelegationsError,
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment