summaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-01-09 18:51:49 -0300
committerSebastian <sebasjm@gmail.com>2024-01-09 18:51:49 -0300
commitf5771cc7b99dc938fd606dcbee350b66ec8027c9 (patch)
tree95c1aa5b8a5e6067c7689b0caf161c50d1f694ed /packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
parent1826b9121a0308aa0a7ac39a89ad7dc8ea2ae965 (diff)
downloadwallet-core-f5771cc7b99dc938fd606dcbee350b66ec8027c9.tar.gz
wallet-core-f5771cc7b99dc938fd606dcbee350b66ec8027c9.tar.bz2
wallet-core-f5771cc7b99dc938fd606dcbee350b66ec8027c9.zip
prepare for 2fa impl
Diffstat (limited to 'packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx')
-rw-r--r--packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
index c785b24df..7a94f5486 100644
--- a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
+++ b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
@@ -21,8 +21,10 @@ import {
Amounts,
CurrencySpecification,
FRAC_SEPARATOR,
+ HttpStatusCode,
Logger,
PaytoString,
+ TalerErrorCode,
TranslatedString,
buildPayto,
parsePaytoUri,
@@ -151,37 +153,37 @@ export function PaytoWireTransferForm({
mutate(() => true)
if (res.type === "fail") {
switch (res.case) {
- case "invalid-input": return notify({
+ case HttpStatusCode.BadRequest: return notify({
type: "error",
title: i18n.str`The request was invalid or the payto://-URI used unacceptable features.`,
description: res.detail.hint as TranslatedString,
debug: res.detail,
})
- case "unauthorized": return notify({
+ case HttpStatusCode.Unauthorized: return notify({
type: "error",
title: i18n.str`Not enough permission to complete the operation.`,
description: res.detail.hint as TranslatedString,
debug: res.detail,
})
- case "creditor-not-found": return notify({
+ case TalerErrorCode.BANK_UNKNOWN_CREDITOR: return notify({
type: "error",
title: i18n.str`The destination account "${puri}" was not found.`,
description: res.detail.hint as TranslatedString,
debug: res.detail,
})
- case "creditor-same": return notify({
+ case TalerErrorCode.BANK_SAME_ACCOUNT: return notify({
type: "error",
title: i18n.str`The origin and the destination of the transfer can't be the same.`,
description: res.detail.hint as TranslatedString,
debug: res.detail,
})
- case "insufficient-funds": return notify({
+ case TalerErrorCode.BANK_UNALLOWED_DEBIT: return notify({
type: "error",
title: i18n.str`Your balance is not enough.`,
description: res.detail.hint as TranslatedString,
debug: res.detail,
})
- case "not-found": return notify({
+ case HttpStatusCode.NotFound: return notify({
type: "error",
title: i18n.str`The origin account "${puri}" was not found.`,
description: res.detail.hint as TranslatedString,