From 55834ea8e3daa8c3daf477c1a9b7ac6053e57da3 Mon Sep 17 00:00:00 2001 From: pociej Date: Wed, 24 Apr 2024 18:23:02 +0200 Subject: [PATCH] fix: use proper address #53 --- frontend/src/hooks/useRequestorWalletAddress.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/hooks/useRequestorWalletAddress.ts b/frontend/src/hooks/useRequestorWalletAddress.ts index fc2e824..47244f8 100644 --- a/frontend/src/hooks/useRequestorWalletAddress.ts +++ b/frontend/src/hooks/useRequestorWalletAddress.ts @@ -4,18 +4,17 @@ import useSWR from "swr"; export const useRequestorWalletAddress = (): { data: | { - wallet: `0x${string}`; + wallet?: `0x${string}`; } | undefined; error?: Error; isLoading: boolean; } => { - const { data, error, isLoading } = useSWR<{ wallet: `0x${string}` }>( - `${import.meta.env.VITE_BACKEND_URL}/requestor`, - axios.get - ); + const { data, error, isLoading } = useSWR<{ + data: { wallet: `0x${string}` }; + }>(`${import.meta.env.VITE_BACKEND_URL}/requestor`, axios.get); return { - data, + data: { wallet: data?.data.wallet }, error, isLoading: isLoading, };