diff options
author | Sebastian <sebasjm@gmail.com> | 2024-01-09 18:51:49 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-01-09 18:51:49 -0300 |
commit | f5771cc7b99dc938fd606dcbee350b66ec8027c9 (patch) | |
tree | 95c1aa5b8a5e6067c7689b0caf161c50d1f694ed /packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx | |
parent | 1826b9121a0308aa0a7ac39a89ad7dc8ea2ae965 (diff) | |
download | wallet-core-f5771cc7b99dc938fd606dcbee350b66ec8027c9.tar.xz |
prepare for 2fa impl
Diffstat (limited to 'packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx b/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx index 43b88ccd8..ed1db854a 100644 --- a/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx +++ b/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx @@ -16,11 +16,13 @@ import { AmountJson, + HttpStatusCode, Logger, PaytoUri, PaytoUriIBAN, PaytoUriTalerBank, TalerError, + TalerErrorCode, TranslatedString, WithdrawUriResult } from "@gnu-taler/taler-util"; @@ -81,8 +83,8 @@ export function WithdrawalConfirmationQuestion({ } if (withdrawalInfo.type === "fail") { switch (withdrawalInfo.case) { - case "not-found": return <OperationNotFound onClose={onAborted} /> - case "invalid-id": return <OperationNotFound onClose={onAborted} /> + case HttpStatusCode.NotFound: return <OperationNotFound onClose={onAborted} /> + case HttpStatusCode.BadRequest: return <OperationNotFound onClose={onAborted} /> default: assertUnreachable(withdrawalInfo) } } @@ -121,31 +123,31 @@ export function WithdrawalConfirmationQuestion({ } } else { switch (resp.case) { - case "previously-aborted": return notify({ + case TalerErrorCode.BANK_CONFIRM_ABORT_CONFLICT: return notify({ type: "error", title: i18n.str`The withdrawal has been aborted previously and can't be confirmed`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }); - case "no-exchange-or-reserve-selected": return notify({ + case TalerErrorCode.BANK_CONFIRM_INCOMPLETE: return notify({ type: "error", title: i18n.str`The withdraw operation cannot be confirmed because no exchange and reserve public key selection happened before`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }); - case "invalid-id": return notify({ + case HttpStatusCode.BadRequest: 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({ + case HttpStatusCode.NotFound: return notify({ type: "error", title: i18n.str`The operation was not found.`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }) - case "insufficient-funds": return notify({ + case TalerErrorCode.BANK_UNALLOWED_DEBIT: return notify({ type: "error", title: i18n.str`Your balance is not enough for the operation.`, description: resp.detail.hint as TranslatedString, @@ -167,17 +169,17 @@ export function WithdrawalConfirmationQuestion({ onAborted(); } else { switch (resp.case) { - case "previously-confirmed": return notify({ + case HttpStatusCode.Conflict: return notify({ type: "error", title: i18n.str`The reserve operation has been confirmed previously and can't be aborted` }); - case "invalid-id": return notify({ + case HttpStatusCode.BadRequest: 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({ + case HttpStatusCode.NotFound: return notify({ type: "error", title: i18n.str`The operation was not found.`, description: resp.detail.hint as TranslatedString, |