From 2e84de134e766b1b7c292136941bdaee80698760 Mon Sep 17 00:00:00 2001 From: jinchung Date: Fri, 20 Oct 2023 18:58:28 -0400 Subject: [PATCH] Update UserAssetsQuery to use new QueryConfigWithSelect type --- src/resources/assets/UserAssetsQuery.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/resources/assets/UserAssetsQuery.ts b/src/resources/assets/UserAssetsQuery.ts index 9aff81da198..de3817a68d0 100644 --- a/src/resources/assets/UserAssetsQuery.ts +++ b/src/resources/assets/UserAssetsQuery.ts @@ -9,7 +9,7 @@ import { rainbowFetch } from '@/rainbow-fetch'; import { createQueryKey, queryClient, - QueryConfig, + QueryConfigWithSelect, QueryFunctionArgs, QueryFunctionResult, } from '@/react-query'; @@ -227,9 +227,14 @@ function parseUserAssetsByChain(message: AddysAccountAssetsResponse) { // /////////////////////////////////////////////// // Query Fetcher (Optional) -export async function fetchUserAssets( +export async function fetchUserAssets( { address, currency, connectedToHardhat }: UserAssetsArgs, - config: QueryConfig = {} + config: QueryConfigWithSelect< + UserAssetsResult, + Error, + TSelectResult, + UserAssetsQueryKey + > = {} ) { return await queryClient.fetchQuery( userAssetsQueryKey({ address, currency, connectedToHardhat }), @@ -241,9 +246,14 @@ export async function fetchUserAssets( // /////////////////////////////////////////////// // Query Hook -export function useUserAssets( +export function useUserAssets( { address, currency, connectedToHardhat }: UserAssetsArgs, - config: QueryConfig = {} + config: QueryConfigWithSelect< + UserAssetsResult, + Error, + TSelectResult, + UserAssetsQueryKey + > = {} ) { return useQuery( userAssetsQueryKey({ address, currency, connectedToHardhat }),