aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/instance/orders/details
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-04-07 18:46:25 -0300
committerSebastian <sebasjm@gmail.com>2023-04-07 18:46:25 -0300
commitcfe7129c4ecaa3057d5e47040f0a9efd8ed0317e (patch)
treec4a282300fec9be588bdb90bc7b94ab9e21ddfd0 /packages/merchant-backoffice-ui/src/paths/instance/orders/details
parent958747bd08172ce00bc84ea3c543eac414a1d39b (diff)
downloadwallet-core-cfe7129c4ecaa3057d5e47040f0a9efd8ed0317e.tar.xz
adding unreadable http response case and removing deprecated fields
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/orders/details')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/orders/details/index.tsx18
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>