summaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
diff options
context:
space:
mode:
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,