From f5771cc7b99dc938fd606dcbee350b66ec8027c9 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 9 Jan 2024 18:51:49 -0300 Subject: prepare for 2fa impl --- .../demobank-ui/src/pages/admin/CreateNewAccount.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'packages/demobank-ui/src/pages/admin/CreateNewAccount.tsx') 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, -- cgit v1.2.3