summaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx')
-rw-r--r--packages/demobank-ui/src/pages/WithdrawalConfirmationQuestion.tsx22
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,