From e812eae32daddad372c7629867298ca28678a44c Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 25 Oct 2023 18:26:36 -0300
Subject: update more error cases handling from bank-core-api

---
 .../src/pages/WithdrawalConfirmationQuestion.tsx   | 26 +++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

(limited to 'packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx')

diff --git a/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx b/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx
index 895094c28..5e0fa322f 100644
--- a/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx
+++ b/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx
@@ -110,6 +110,18 @@ export function WithdrawalConfirmationQuestion({
             description: resp.detail.hint as TranslatedString,
             debug: resp.detail,
           });
+          case "invalid-id": return notify({
+            type: "error",
+            title: i18n.str`The operation id is invalid.`,
+            description: resp.detail.hint as TranslatedString,
+            debug: resp.detail,
+          })
+          case "not-found": return notify({
+            type: "error",
+            title: i18n.str`The operation was not found.`,
+            description: resp.detail.hint as TranslatedString,
+            debug: resp.detail,
+          })
           default: assertUnreachable(resp)
         }
       }
@@ -129,8 +141,20 @@ export function WithdrawalConfirmationQuestion({
             type: "error",
             title: i18n.str`The reserve operation has been confirmed previously and can't be aborted`
           });
+          case "invalid-id": return notify({
+            type: "error",
+            title: i18n.str`The operation id is invalid.`,
+            description: resp.detail.hint as TranslatedString,
+            debug: resp.detail,
+          })
+          case "not-found": return notify({
+            type: "error",
+            title: i18n.str`The operation was not found.`,
+            description: resp.detail.hint as TranslatedString,
+            debug: resp.detail,
+          })
           default: {
-            assertUnreachable(resp.case)
+            assertUnreachable(resp)
           }
         }
       }
-- 
cgit v1.2.3

