aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/hooks/backend.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/hooks/backend.ts')
-rw-r--r--packages/merchant-backoffice-ui/src/hooks/backend.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/merchant-backoffice-ui/src/hooks/backend.ts b/packages/merchant-backoffice-ui/src/hooks/backend.ts
index 3610e0494..90fd320a9 100644
--- a/packages/merchant-backoffice-ui/src/hooks/backend.ts
+++ b/packages/merchant-backoffice-ui/src/hooks/backend.ts
@@ -70,7 +70,9 @@ export function useBackendInstancesTestForAdmin(): HttpResponse<
useEffect(() => {
request<Type>(`/management/instances`)
.then((data) => setResult(data))
- .catch((error) => setResult(error));
+ .catch((error: RequestError<MerchantBackend.ErrorDetail>) =>
+ setResult(error.cause),
+ );
}, [request]);
return result;
@@ -78,14 +80,14 @@ export function useBackendInstancesTestForAdmin(): HttpResponse<
export function useBackendConfig(): HttpResponse<
MerchantBackend.VersionResponse,
- MerchantBackend.ErrorDetail
+ RequestError<MerchantBackend.ErrorDetail>
> {
const { request } = useBackendBaseRequest();
type Type = MerchantBackend.VersionResponse;
const [result, setResult] = useState<
- HttpResponse<Type, MerchantBackend.ErrorDetail>
+ HttpResponse<Type, RequestError<MerchantBackend.ErrorDetail>>
>({ loading: true });
useEffect(() => {