diff options
author | Sebastian <sebasjm@gmail.com> | 2023-04-26 14:20:18 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-04-26 14:20:18 -0300 |
commit | 03d3cce8274fcbf6fb9cb8be03e867136f196c5d (patch) | |
tree | 4358ce334c9cccf95755271dbdca46f3eb7787d0 /packages/merchant-backoffice-ui/src/paths/instance/update | |
parent | 982fc51a97389ef8863de806dab496b0fe2102c6 (diff) | |
download | wallet-core-03d3cce8274fcbf6fb9cb8be03e867136f196c5d.tar.xz |
fix #6363, breaking with merchant backend that accounts implemented
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/update')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/update/UpdatePage.tsx | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/update/UpdatePage.tsx index 2b57ab429..ecf6e2ae5 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/update/UpdatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/update/UpdatePage.tsx @@ -53,14 +53,23 @@ interface Props { function convert( from: MerchantBackend.Instances.QueryInstancesResponse, ): Entity { - const { accounts, ...rest } = from; - const payto_uris = accounts.filter((a) => a.active).map((a) => a.payto_uri); + const { accounts: qAccounts, ...rest } = from; + const accounts = qAccounts + .filter((a) => a.active) + .map( + (a) => + ({ + payto_uri: a.payto_uri, + credit_facade_url: a.credit_facade_url, + credit_facade_credentials: a.credit_facade_credentials, + } as MerchantBackend.Instances.MerchantBankAccount), + ); const defaults = { default_wire_fee_amortization: 1, default_pay_delay: { d_us: 2 * 1000 * 1000 * 60 * 60 }, //two hours default_wire_transfer_delay: { d_us: 2 * 1000 * 1000 * 60 * 60 * 2 }, //two hours }; - return { ...defaults, ...rest, payto_uris }; + return { ...defaults, ...rest, accounts }; } function getTokenValuePart(t?: string): string | undefined { @@ -103,12 +112,14 @@ export function UpdatePage({ : value.user_type !== "business" && value.user_type !== "individual" ? i18n.str`should be business or individual` : undefined, - payto_uris: - !value.payto_uris || !value.payto_uris.length + accounts: + !value.accounts || !value.accounts.length ? i18n.str`required` : undefinedIfEmpty( - value.payto_uris.map((p) => { - return !PAYTO_REGEX.test(p) ? i18n.str`is not valid` : undefined; + value.accounts.map((p) => { + return !PAYTO_REGEX.test(p.payto_uri) + ? i18n.str`is not valid` + : undefined; }), ), default_max_deposit_fee: !value.default_max_deposit_fee |