diff options
author | Sebastian <sebasjm@gmail.com> | 2024-06-13 15:23:31 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-06-13 15:23:40 -0300 |
commit | 4f7eac1af8704d11fb3f58650558f932791f3d8e (patch) | |
tree | 08b029e79a44d454a8eff40d38dd2439f3051dba /packages/merchant-backoffice-ui/src/components/form | |
parent | 70926f609c766d47235a1fc47f189482bc9052bd (diff) | |
download | wallet-core-4f7eac1af8704d11fb3f58650558f932791f3d8e.tar.xz |
fix checking bank account with revenue api
Diffstat (limited to 'packages/merchant-backoffice-ui/src/components/form')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx b/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx index 4ac798afe..9cec72c01 100644 --- a/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx +++ b/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx @@ -222,14 +222,15 @@ export function InputPaytoForm<T>({ if (nv !== undefined && nv.isKnown) { if (nv.targetType === "iban" && paths.length >= 2) { //FIXME: workaround EBIC not supported - paths[0] = paths[1] + paths[0] = paths[1]; + delete paths[1]; } setValue({ target: nv.targetType, params: nv.params, path1: paths.length >= 1 ? paths[0] : undefined, path2: paths.length >= 2 ? paths[1] : undefined, - }); + }); } }, [initialValueStr]); @@ -267,17 +268,20 @@ export function InputPaytoForm<T>({ const path1WithSlash = value.path1 && !value.path1.endsWith("/") ? value.path1 + "/" : value.path1; - const str = + const pto = hasErrors || !value.target ? undefined - : stringifyPaytoUri({ + : { targetType: value.target, targetPath: value.path2 ? `${path1WithSlash}${value.path2}` : value.path1 ?? "", params: value.params ?? ({} as any), - isKnown: false, - }); + isKnown: false as const, + }; + + const str = !pto ? undefined : stringifyPaytoUri(pto); + useEffect(() => { onChange(str as any); }, [str]); |