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/templates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/hooks/templates.ts') diff --git a/packages/merchant-backoffice-ui/src/hooks/templates.ts b/packages/merchant-backoffice-ui/src/hooks/templates.ts index 39a106537..56cdd3046 100644 --- a/packages/merchant-backoffice-ui/src/hooks/templates.ts +++ b/packages/merchant-backoffice-ui/src/hooks/templates.ts @@ -170,7 +170,7 @@ export function useInstanceTemplates( }, [afterData /*, beforeData*/]); // if (beforeError) return beforeError; - if (afterError) return afterError.info; + if (afterError) return afterError.cause; // if the query returns less that we ask, then we have reach the end or beginning const isReachingEnd = @@ -247,6 +247,6 @@ export function useTemplateDetails( if (data) { return data; } - if (error) return error.info; + if (error) return error.cause; return { loading: true }; } -- cgit v1.2.3