From da93d2ba7eca78359490d5e35b8c70b2bcaf4072 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 12 May 2023 11:23:38 -0300 Subject: fix getting wrong error message after 401 response in merchant backoffice --- packages/merchant-backoffice-ui/src/hooks/instance.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/hooks/instance.ts') diff --git a/packages/merchant-backoffice-ui/src/hooks/instance.ts b/packages/merchant-backoffice-ui/src/hooks/instance.ts index 8a882218b..eae65d64c 100644 --- a/packages/merchant-backoffice-ui/src/hooks/instance.ts +++ b/packages/merchant-backoffice-ui/src/hooks/instance.ts @@ -205,7 +205,7 @@ export function useInstanceDetails(): HttpResponse< if (isValidating) return { loading: true, data: data?.data }; if (data) return data; - if (error) return error.info; + if (error) return error.cause; return { loading: true }; } @@ -240,7 +240,7 @@ export function useInstanceKYCDetails(): HttpResponse< return { ok: true, data: { type: "redirect", status: data.data } }; return { ok: true, data: { type: "ok" } }; } - if (error) return error.info; + if (error) return error.cause; return { loading: true }; } @@ -268,7 +268,7 @@ export function useManagedInstanceDetails( if (isValidating) return { loading: true, data: data?.data }; if (data) return data; - if (error) return error.info; + if (error) return error.cause; return { loading: true }; } @@ -285,6 +285,6 @@ export function useBackendInstances(): HttpResponse< if (isValidating) return { loading: true, data: data?.data }; if (data) return data; - if (error) return error.info; + if (error) return error.cause; return { loading: true }; } -- cgit v1.2.3