diff options
author | Sebastian <sebasjm@gmail.com> | 2024-06-19 08:30:22 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-06-19 08:30:46 -0300 |
commit | 3418a2fcb4b73374b5433052d05978cf9212093c (patch) | |
tree | 9f4eb6a48841e8450c93667f98c0af34329c8f08 /packages/merchant-backoffice-ui/src/paths/instance/accounts/create | |
parent | 107c89732ee944844d9b9fb74b727f5a3e3e983c (diff) | |
download | wallet-core-3418a2fcb4b73374b5433052d05978cf9212093c.tar.xz |
filter accounts based on active status
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/accounts/create')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx | 14 |
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; } } |