diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx index 986c46b95..4d0d48e47 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx @@ -16,6 +16,7 @@ import { useTranslationContext, HttpError, + ErrorType, } from "@gnu-taler/web-util/lib/index.browser"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; @@ -25,6 +26,7 @@ import { MerchantBackend } from "../../../../declaration.js"; import { useOrderAPI, useOrderDetails } from "../../../../hooks/order.js"; import { Notification } from "../../../../utils/types.js"; import { DetailPage } from "./DetailPage.js"; +import { HttpStatusCode } from "@gnu-taler/taler-util"; export interface Props { oid: string; @@ -48,10 +50,20 @@ export default function Update({ const { i18n } = useTranslationContext(); - if (result.clientError && result.isUnauthorized) return onUnauthorized(); - if (result.clientError && result.isNotfound) return onNotFound(); if (result.loading) return <Loading />; - if (!result.ok) return onLoadError(result); + if (!result.ok) { + if ( + result.type === ErrorType.CLIENT && + result.status === HttpStatusCode.Unauthorized + ) + return onUnauthorized(); + if ( + result.type === ErrorType.CLIENT && + result.status === HttpStatusCode.NotFound + ) + return onNotFound(); + return onLoadError(result); + } return ( <Fragment> |