gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: handle not found cases


From: gnunet
Subject: [taler-wallet-core] branch master updated: handle not found cases
Date: Thu, 04 Apr 2024 18:26:51 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 58323fc49 handle not found cases
58323fc49 is described below

commit 58323fc496d0fe2a34884b289860264ffd1310e8
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Thu Apr 4 13:26:46 2024 -0300

    handle not found cases
---
 .../src/paths/instance/details/index.tsx                       |  6 +++++-
 .../src/paths/instance/kyc/list/index.tsx                      | 10 ++++++++--
 .../src/paths/instance/orders/create/index.tsx                 |  5 ++++-
 .../src/paths/instance/orders/list/index.tsx                   |  5 ++++-
 .../merchant-backoffice-ui/src/paths/instance/token/index.tsx  |  6 +++++-
 .../src/paths/instance/transfers/list/index.tsx                |  6 +++++-
 .../merchant-backoffice-ui/src/paths/instance/update/index.tsx |  6 +++++-
 7 files changed, 36 insertions(+), 8 deletions(-)

diff --git 
a/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx 
b/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx
index 5b6564485..bb1ee944b 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/details/index.tsx
@@ -24,6 +24,7 @@ import { useSessionContext } from 
"../../../context/session.js";
 import { useInstanceDetails } from "../../../hooks/instance.js";
 import { LoginPage } from "../../login/index.js";
 import { DetailPage } from "./DetailPage.js";
+import { NotFoundPageOrAdminCreate } from "../../notfound/index.js";
 
 interface Props {
   onUpdate: () => void;
@@ -50,8 +51,11 @@ export default function Detail({
       case HttpStatusCode.Unauthorized: {
         return <LoginPage />
       }
+      case HttpStatusCode.NotFound: {
+        return <NotFoundPageOrAdminCreate />;
+      }
       default: {
-        assertUnreachable(result.case)
+        assertUnreachable(result)
       }
     }
   }
diff --git 
a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx 
b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx
index 32c7b6c7f..ed0e1220f 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/kyc/list/index.tsx
@@ -24,7 +24,6 @@ import { VNode, h } from "preact";
 import { ErrorLoadingMerchant } from 
"../../../../components/ErrorLoadingMerchant.js";
 import { Loading } from "../../../../components/exception/loading.js";
 import { useInstanceKYCDetails } from "../../../../hooks/instance.js";
-import { LoginPage } from "../../../login/index.js";
 import { ListPage } from "./ListPage.js";
 
 interface Props {
@@ -36,6 +35,10 @@ export default function ListKYC(_p: Props): VNode {
   if (result instanceof TalerError) {
     return <ErrorLoadingMerchant error={result} />
   }
+  /**
+   * This component just render known kyc requirements.
+   * If query fail then is safe to hide errors.
+   */
   if (result.type === "fail") {
     switch (result.case) {
       case HttpStatusCode.GatewayTimeout: {
@@ -54,7 +57,10 @@ export default function ListKYC(_p: Props): VNode {
         return <div />
       }
       case HttpStatusCode.Unauthorized: {
-        return <LoginPage />
+        return <div />
+      }
+      case HttpStatusCode.NotFound: {
+        return <div />;
       }
       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 10b115905..f612389fe 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
@@ -61,8 +61,11 @@ export default function OrderCreate({
       case HttpStatusCode.Unauthorized: {
         return <LoginPage />
       }
+      case HttpStatusCode.NotFound: {
+        return <NotFoundPageOrAdminCreate />;
+      }
       default: {
-        assertUnreachable(detailsResult.case);
+        assertUnreachable(detailsResult);
       }
     }
   }
diff --git 
a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx 
b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx
index 8efef1c1b..165ced3dc 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/orders/list/index.tsx
@@ -78,11 +78,14 @@ export default function OrderList({ onCreate, onSelect }: 
Props): VNode {
   }
   if (result.type === "fail") {
     switch(result.case) {
+      case HttpStatusCode.NotFound: {
+        return <NotFoundPageOrAdminCreate />;
+      }
       case HttpStatusCode.Unauthorized: {
         return <LoginPage />
       }
       default: {
-        assertUnreachable(result.case)
+        assertUnreachable(result)
       }
     }
   }
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx 
b/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx
index 36ba10e30..768e21325 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx
@@ -25,6 +25,7 @@ import { useInstanceDetails } from 
"../../../hooks/instance.js";
 import { Notification } from "../../../utils/types.js";
 import { LoginPage } from "../../login/index.js";
 import { DetailPage } from "./DetailPage.js";
+import { NotFoundPageOrAdminCreate } from "../../notfound/index.js";
 
 interface Props {
   onChange: () => void;
@@ -50,8 +51,11 @@ export default function Token({
       case HttpStatusCode.Unauthorized: {
         return <LoginPage />
       }
+      case HttpStatusCode.NotFound: {
+        return <NotFoundPageOrAdminCreate />;
+      }
       default: {
-        assertUnreachable(result.case)
+        assertUnreachable(result)
       }
     }
   }
diff --git 
a/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/index.tsx 
b/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/index.tsx
index b53f67884..6c451aab8 100644
--- 
a/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/index.tsx
+++ 
b/packages/merchant-backoffice-ui/src/paths/instance/transfers/list/index.tsx
@@ -28,6 +28,7 @@ import { useInstanceBankAccounts } from 
"../../../../hooks/bank.js";
 import { useInstanceTransfers } from "../../../../hooks/transfer.js";
 import { LoginPage } from "../../../login/index.js";
 import { ListPage } from "./ListPage.js";
+import { NotFoundPageOrAdminCreate } from "../../../notfound/index.js";
 
 interface Props {
   onCreate: () => void;
@@ -79,8 +80,11 @@ export default function ListTransfer({
       case HttpStatusCode.Unauthorized: {
         return <LoginPage />
       }
+      case HttpStatusCode.NotFound: {
+        return <NotFoundPageOrAdminCreate />;
+      }
       default: {
-        assertUnreachable(result.case);
+        assertUnreachable(result);
       }
     }
   }
diff --git 
a/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx 
b/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx
index de3ffce48..b5319bc2d 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx
@@ -31,6 +31,7 @@ import {
 import { Notification } from "../../../utils/types.js";
 import { LoginPage } from "../../login/index.js";
 import { UpdatePage } from "./UpdatePage.js";
+import { NotFoundPageOrAdminCreate } from "../../notfound/index.js";
 
 export interface Props {
   onBack: () => void;
@@ -79,8 +80,11 @@ function CommonUpdate(
       case HttpStatusCode.Unauthorized: {
         return <LoginPage />
       }
+      case HttpStatusCode.NotFound: {
+        return <NotFoundPageOrAdminCreate />;
+      }
       default: {
-        assertUnreachable(result.case)
+        assertUnreachable(result)
       }
     }
   }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]