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/admin/CreateNewAccount.tsx | |
parent | 1826b9121a0308aa0a7ac39a89ad7dc8ea2ae965 (diff) | |
download | wallet-core-f5771cc7b99dc938fd606dcbee350b66ec8027c9.tar.xz |
prepare for 2fa impl
Diffstat (limited to 'packages/demobank-ui/src/pages/admin/CreateNewAccount.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/admin/CreateNewAccount.tsx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/demobank-ui/src/pages/admin/CreateNewAccount.tsx b/packages/demobank-ui/src/pages/admin/CreateNewAccount.tsx index 3d196973e..d6b7d5b1e 100644 --- a/packages/demobank-ui/src/pages/admin/CreateNewAccount.tsx +++ b/packages/demobank-ui/src/pages/admin/CreateNewAccount.tsx @@ -1,4 +1,4 @@ -import { TalerCorebankApi, TranslatedString } from "@gnu-taler/taler-util"; +import { HttpStatusCode, TalerCorebankApi, TalerErrorCode, TranslatedString } from "@gnu-taler/taler-util"; import { Attention, LocalNotificationBanner, notifyInfo, useLocalNotification, useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; @@ -48,43 +48,43 @@ export function CreateNewAccount({ onCreateSuccess(); } else { switch (resp.case) { - case "invalid-phone-or-email": return notify({ + case HttpStatusCode.BadRequest: return notify({ type: "error", - title: i18n.str`Server replied with invalid phone or email`, + title: i18n.str`Server replied that phone or email is invalid`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }) - case "unauthorized": return notify({ + case HttpStatusCode.Unauthorized: return notify({ type: "error", title: i18n.str`The rights to perform the operation are not sufficient`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }) - case "username-already-exists": return notify({ + case TalerErrorCode.BANK_REGISTER_USERNAME_REUSE: return notify({ type: "error", title: i18n.str`Account username is already taken`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }) - case "payto-already-exists": return notify({ + case TalerErrorCode.BANK_REGISTER_PAYTO_URI_REUSE: return notify({ type: "error", title: i18n.str`Account id is already taken`, 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`Bank ran out of bonus credit.`, 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`Account username can't be used because is reserved`, description: resp.detail.hint as TranslatedString, debug: resp.detail, }) - case "user-cant-set-debt": return notify({ + case TalerErrorCode.BANK_NON_ADMIN_PATCH_DEBT_LIMIT: return notify({ type: "error", title: i18n.str`Only admin is allow to set debt limit.`, description: resp.detail.hint as TranslatedString, |