From 3418a2fcb4b73374b5433052d05978cf9212093c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 19 Jun 2024 08:30:22 -0300 Subject: filter accounts based on active status --- .../src/paths/instance/accounts/create/index.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/paths/instance/accounts/create') 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; } } -- cgit v1.2.3