aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx
index 2c1a13e27..6994c579c 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx
@@ -63,7 +63,15 @@ export default function CreateValidator({ onConfirm, onBack }: Props): VNode {
onCreate={async (request: Entity) => {
return api.instance
.addBankAccount(state.token, request)
- .then(() => {
+ .then((created) => {
+ if (created.type === "fail") {
+ setNotif({
+ message: i18n.str`could not create account`,
+ type: "ERROR",
+ description: created.detail.hint,
+ });
+ return;
+ }
onConfirm();
})
.catch((error) => {
@@ -120,7 +128,7 @@ export async function testRevenueAPI(
if (resp.type === "fail") {
return resp;
}
-
+
return opFixedSuccess(resp.body.credit_account as PaytoString);
} catch (err) {
if (err instanceof TalerError) {
@@ -131,6 +139,6 @@ export async function testRevenueAPI(
// detail: err.errorDetail,
// };
}
- throw err
+ throw err;
}
}