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