diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/orders/create')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx | 4 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx index d7abc4fbe..32f3f05c7 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/OrderCreatedSuccessfully.tsx @@ -21,6 +21,7 @@ import { CreatedSuccessfully } from "../../../../components/notifications/Create import { useOrderDetails } from "../../../../hooks/order.js"; import { NotFoundPageOrAdminCreate } from "../../../notfound/index.js"; import { Entity } from "./index.js"; +import { LoginPage } from "../../../login/index.js"; interface Props { entity: Entity; @@ -53,6 +54,9 @@ export function OrderCreatedSuccessfully({ <div>The merchant's interaction with the exchange took too long</div> ); } + case HttpStatusCode.Unauthorized: { + return <LoginPage /> + } default: { assertUnreachable(result) } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx index e40e766dd..10b115905 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx @@ -32,6 +32,7 @@ import { useInstanceProducts } from "../../../../hooks/product.js"; import { Notification } from "../../../../utils/types.js"; import { CreatePage } from "./CreatePage.js"; import { NotFoundPageOrAdminCreate } from "../../../notfound/index.js"; +import { LoginPage } from "../../../login/index.js"; export type Entity = { request: TalerMerchantApi.PostOrderRequest; @@ -55,6 +56,16 @@ export default function OrderCreate({ if (detailsResult instanceof TalerError) { return <ErrorLoadingMerchant error={detailsResult} /> } + if (detailsResult.type === "fail") { + switch (detailsResult.case) { + case HttpStatusCode.Unauthorized: { + return <LoginPage /> + } + default: { + assertUnreachable(detailsResult.case); + } + } + } if (!inventoryResult) return <Loading /> if (inventoryResult instanceof TalerError) { return <ErrorLoadingMerchant error={inventoryResult} /> @@ -64,8 +75,11 @@ export default function OrderCreate({ case HttpStatusCode.NotFound: { return <NotFoundPageOrAdminCreate />; } + case HttpStatusCode.Unauthorized: { + return <LoginPage /> + } default: { - assertUnreachable(inventoryResult.case); + assertUnreachable(inventoryResult); } } } |