diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/orders/create/index.tsx | 16 |
1 files changed, 15 insertions, 1 deletions
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); } } } |