diff options
Diffstat (limited to 'packages/demobank-ui/src/pages/admin/RemoveAccount.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/admin/RemoveAccount.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx b/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx index 0d294a3a6..d47f48dd9 100644 --- a/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx +++ b/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx @@ -1,4 +1,4 @@ -import { Amounts, TalerError, TranslatedString } from "@gnu-taler/taler-util"; +import { Amounts, HttpStatusCode, TalerError, TalerErrorCode, TranslatedString } from "@gnu-taler/taler-util"; import { Attention, Loading, LocalNotificationBanner, ShowInputErrorLabel, notifyInfo, useLocalNotification, useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; @@ -39,8 +39,8 @@ export function RemoveAccount({ } if (result.type === "fail") { switch (result.case) { - case "unauthorized": return <LoginForm currentUser={account} /> - case "not-found": return <LoginForm currentUser={account} /> + case HttpStatusCode.Unauthorized: return <LoginForm currentUser={account} /> + case HttpStatusCode.NotFound: return <LoginForm currentUser={account} /> default: assertUnreachable(result) } } @@ -65,25 +65,25 @@ export function RemoveAccount({ onUpdateSuccess(); } else { switch (resp.case) { - case "unauthorized": return notify({ + case HttpStatusCode.Unauthorized: return notify({ type: "error", title: i18n.str`No enough permission to delete the account.`, 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 username was not found.`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }) - case "username-reserved": return notify({ + case TalerErrorCode.BANK_RESERVED_USERNAME_CONFLICT: return notify({ type: "error", title: i18n.str`Can't delete a reserved username.`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }) - case "balance-not-zero": return notify({ + case TalerErrorCode.BANK_ACCOUNT_BALANCE_NOT_ZERO: return notify({ type: "error", title: i18n.str`Can't delete an account with balance different than zero.`, description: resp.detail.hint as TranslatedString, |