@tesouro/embedded-components-react 0.3.13 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +30 -30
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +23 -205
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +200 -185
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +199 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +105 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +12 -46
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +46 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +26 -158
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +162 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +32 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +102 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +13 -242
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +247 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +4 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +28 -82
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +76 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +145 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +3 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +2 -43
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +45 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +6 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +9 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +7 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +14 -51
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +59 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -110
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +107 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +8 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +38 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +18 -98
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +92 -173
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +180 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +5 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +6 -112
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +114 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +0 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index392.js +124 -124
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index418.js +116 -116
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index443.js +94 -94
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1028 -1019
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +2625 -2626
- package/package.json +1 -1
|
@@ -6,157 +6,157 @@ import { useMoniteContext as r } from "./index47.js";
|
|
|
6
6
|
import { useRootElements as i } from "./index206.js";
|
|
7
7
|
import "./index207.js";
|
|
8
8
|
import { useFileInput as a } from "./index209.js";
|
|
9
|
-
import { useComponentSettings as
|
|
9
|
+
import { useComponentSettings as ee } from "./index215.js";
|
|
10
10
|
import "./index217.js";
|
|
11
|
-
import { Dialog as
|
|
11
|
+
import { Dialog as o } from "./index229.js";
|
|
12
12
|
import "./index230.js";
|
|
13
|
-
import { MoniteScopedProviders as
|
|
14
|
-
import { useUserPermissions as
|
|
15
|
-
import { AccessRestriction as
|
|
13
|
+
import { MoniteScopedProviders as s } from "./index237.js";
|
|
14
|
+
import { useUserPermissions as te } from "./index116.js";
|
|
15
|
+
import { AccessRestriction as c } from "./index247.js";
|
|
16
16
|
import "./index249.js";
|
|
17
|
-
import { usePayableCallbacks as
|
|
18
|
-
import { PayableDetails as
|
|
19
|
-
import { PayablesTable as
|
|
17
|
+
import { usePayableCallbacks as l } from "./index361.js";
|
|
18
|
+
import { PayableDetails as u } from "./index425.js";
|
|
19
|
+
import { PayablesTable as ne } from "./index438.js";
|
|
20
20
|
import "./index426.js";
|
|
21
21
|
import "./index439.js";
|
|
22
|
-
import { CreatePayableMenu as
|
|
22
|
+
import { CreatePayableMenu as d } from "./index441.js";
|
|
23
23
|
import "./index442.js";
|
|
24
|
-
import { useEffect as
|
|
25
|
-
import { jsx as
|
|
26
|
-
import { toast as
|
|
27
|
-
import { useLingui as
|
|
24
|
+
import { useEffect as re, useMemo as ie, useRef as ae, useState as f } from "react";
|
|
25
|
+
import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
|
|
26
|
+
import { toast as h } from "react-hot-toast";
|
|
27
|
+
import { useLingui as g } from "@lingui/react";
|
|
28
28
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index443.js
|
|
29
|
-
var
|
|
30
|
-
let { i18n:
|
|
31
|
-
onSaved:
|
|
32
|
-
onCanceled:
|
|
33
|
-
onSubmitted:
|
|
34
|
-
onRejected:
|
|
35
|
-
onApproved:
|
|
36
|
-
onReopened:
|
|
37
|
-
onDeleted:
|
|
38
|
-
onPay:
|
|
39
|
-
}), [
|
|
29
|
+
var _ = (e) => /* @__PURE__ */ p(s, { children: /* @__PURE__ */ p(v, { ...e }) }), v = ({ pageTitleComponent: s, enableGLCodes: _, initialView: v, initialCounterpartId: y, onSaved: b, onCanceled: x, onSubmitted: S, onRejected: C, onApproved: oe, onReopened: se, onDeleted: ce, onPay: le }) => {
|
|
30
|
+
let { i18n: w } = g(), { api: T, queryClient: E, theme: D } = r(), { componentSettings: O } = ee(), { handleSaved: k, handleCanceled: A, handleSubmitted: j, handleRejected: M, handleApproved: N, handleReopened: P, handleDeleted: F, handlePay: I } = l({
|
|
31
|
+
onSaved: b,
|
|
32
|
+
onCanceled: x,
|
|
33
|
+
onSubmitted: S,
|
|
34
|
+
onRejected: C,
|
|
35
|
+
onApproved: oe,
|
|
36
|
+
onReopened: se,
|
|
37
|
+
onDeleted: ce,
|
|
38
|
+
onPay: le
|
|
39
|
+
}), [L, R] = f({
|
|
40
40
|
invoiceId: void 0,
|
|
41
41
|
open: !1,
|
|
42
42
|
shouldOpenEditMode: !1
|
|
43
|
-
}),
|
|
44
|
-
|
|
43
|
+
}), z = () => {
|
|
44
|
+
R((e) => ({
|
|
45
45
|
...e,
|
|
46
46
|
open: !1,
|
|
47
47
|
shouldOpenEditMode: !1,
|
|
48
48
|
invoiceId: void 0
|
|
49
49
|
}));
|
|
50
|
-
}, [
|
|
51
|
-
|
|
52
|
-
}, { FileInput:
|
|
53
|
-
onSuccess: () =>
|
|
50
|
+
}, [B, V] = f(!1), [H, U] = f(void 0), W = ae(!1), G = () => {
|
|
51
|
+
V(!1), U(void 0);
|
|
52
|
+
}, { FileInput: ue, openFileInput: de, checkFileError: fe } = a(), K = T.finops.postPayablesUploadFromFile.useMutation({}, {
|
|
53
|
+
onSuccess: () => T.finops.getPayables.invalidateQueries(E),
|
|
54
54
|
onError: () => {}
|
|
55
|
-
}),
|
|
55
|
+
}), q = (e) => {
|
|
56
56
|
let n = e instanceof File ? [e] : Array.from(e);
|
|
57
57
|
if (n.length > 10) {
|
|
58
|
-
|
|
58
|
+
h.error(w._("You can only upload up to {fileCount} files at a time", { fileCount: 10 }));
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
n.forEach((e) => {
|
|
62
|
-
let n =
|
|
62
|
+
let n = fe(e);
|
|
63
63
|
if (n) {
|
|
64
|
-
|
|
64
|
+
h.error(n);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
loading:
|
|
69
|
-
success:
|
|
70
|
-
error: (e) => t(
|
|
67
|
+
h.promise(K.mutateAsync({ file: e }), {
|
|
68
|
+
loading: w._("Uploading {fileName}", { fileName: e.name }),
|
|
69
|
+
success: w._("Payable {fileName} uploaded successfully", { fileName: e.name }),
|
|
70
|
+
error: (e) => t(w, e)
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
}, J = te(), Y = J.has(e.PayableWriteOrg), X = J.has(e.PayableReadOrg);
|
|
74
|
+
re(() => {
|
|
75
|
+
W.current || v === "create" && Y && (W.current = !0, U(y), V(!0));
|
|
76
76
|
}, [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
v,
|
|
78
|
+
Y,
|
|
79
|
+
y
|
|
80
80
|
]);
|
|
81
|
-
let { root:
|
|
82
|
-
return /* @__PURE__ */
|
|
81
|
+
let { root: Z } = i(), Q = "Monite-Payables-Header", $ = _ ?? O?.payables?.enableGLCodes ?? !1, pe = ie(() => n(D.components?.styles?.payables?.button), [D.components?.styles?.payables?.button]);
|
|
82
|
+
return /* @__PURE__ */ m("div", {
|
|
83
83
|
className: "Monite-Payables",
|
|
84
|
-
style:
|
|
84
|
+
style: pe,
|
|
85
85
|
children: [
|
|
86
|
-
|
|
87
|
-
isCreateAllowed:
|
|
86
|
+
s(/* @__PURE__ */ p(d, {
|
|
87
|
+
isCreateAllowed: Y,
|
|
88
88
|
onCreateInvoice: () => {
|
|
89
|
-
|
|
89
|
+
U(void 0), V(!0);
|
|
90
90
|
},
|
|
91
|
-
handleFileUpload:
|
|
91
|
+
handleFileUpload: q
|
|
92
92
|
})),
|
|
93
|
-
!
|
|
94
|
-
|
|
95
|
-
initialCounterpartId:
|
|
96
|
-
onRowClick: (e) =>
|
|
93
|
+
!X && /* @__PURE__ */ p(c, {}),
|
|
94
|
+
X && /* @__PURE__ */ p(ne, {
|
|
95
|
+
initialCounterpartId: v === "create" ? void 0 : y,
|
|
96
|
+
onRowClick: (e) => R({
|
|
97
97
|
open: !0,
|
|
98
98
|
invoiceId: e
|
|
99
99
|
}),
|
|
100
|
-
onPay:
|
|
101
|
-
onApproved:
|
|
102
|
-
onCanceled:
|
|
103
|
-
onSubmitted:
|
|
104
|
-
openFileInput:
|
|
105
|
-
setIsCreateInvoiceDialogOpen:
|
|
106
|
-
openEditDialog: (e) =>
|
|
100
|
+
onPay: I,
|
|
101
|
+
onApproved: N,
|
|
102
|
+
onCanceled: A,
|
|
103
|
+
onSubmitted: j,
|
|
104
|
+
openFileInput: de,
|
|
105
|
+
setIsCreateInvoiceDialogOpen: V,
|
|
106
|
+
openEditDialog: (e) => R({
|
|
107
107
|
open: !0,
|
|
108
108
|
invoiceId: e,
|
|
109
109
|
shouldOpenEditMode: !0
|
|
110
110
|
})
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
"aria-label":
|
|
112
|
+
/* @__PURE__ */ p(ue, {
|
|
113
|
+
"aria-label": w._("Upload payable files"),
|
|
114
114
|
multiple: !0,
|
|
115
115
|
onChange: (e) => {
|
|
116
116
|
let t = e.target.files;
|
|
117
|
-
t &&
|
|
117
|
+
t && q(t);
|
|
118
118
|
}
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
className: "
|
|
122
|
-
open:
|
|
123
|
-
container:
|
|
124
|
-
onClose:
|
|
125
|
-
onClosed:
|
|
120
|
+
/* @__PURE__ */ p(o, {
|
|
121
|
+
className: Q + "-Dialog-PayableDetails",
|
|
122
|
+
open: L.open,
|
|
123
|
+
container: Z,
|
|
124
|
+
onClose: z,
|
|
125
|
+
onClosed: z,
|
|
126
126
|
fullScreen: !0,
|
|
127
|
-
children: /* @__PURE__ */
|
|
128
|
-
id:
|
|
129
|
-
shouldOpenInEditMode:
|
|
127
|
+
children: /* @__PURE__ */ p(u, {
|
|
128
|
+
id: L.invoiceId,
|
|
129
|
+
shouldOpenInEditMode: L.shouldOpenEditMode,
|
|
130
130
|
enableGLCodes: $,
|
|
131
|
-
onClose:
|
|
132
|
-
onSaved:
|
|
133
|
-
onCanceled:
|
|
134
|
-
onSubmitted:
|
|
135
|
-
onRejected:
|
|
136
|
-
onApproved:
|
|
137
|
-
onReopened:
|
|
131
|
+
onClose: z,
|
|
132
|
+
onSaved: k,
|
|
133
|
+
onCanceled: A,
|
|
134
|
+
onSubmitted: j,
|
|
135
|
+
onRejected: M,
|
|
136
|
+
onApproved: N,
|
|
137
|
+
onReopened: P,
|
|
138
138
|
onDeleted: (e) => {
|
|
139
|
-
|
|
139
|
+
F?.(e), z(), h(w._("Bill #{payableId} has been deleted", { payableId: e }), { duration: 5e3 });
|
|
140
140
|
},
|
|
141
|
-
onPay:
|
|
141
|
+
onPay: I
|
|
142
142
|
})
|
|
143
143
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
className: "
|
|
146
|
-
open:
|
|
147
|
-
container:
|
|
148
|
-
onClose:
|
|
144
|
+
/* @__PURE__ */ p(o, {
|
|
145
|
+
className: Q + "-Dialog-CreatePayable",
|
|
146
|
+
open: B,
|
|
147
|
+
container: Z,
|
|
148
|
+
onClose: G,
|
|
149
149
|
fullScreen: !0,
|
|
150
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ p(u, {
|
|
151
151
|
shouldOpenInEditMode: !0,
|
|
152
|
-
initialCounterpartId:
|
|
152
|
+
initialCounterpartId: H,
|
|
153
153
|
enableGLCodes: $,
|
|
154
|
-
onClose:
|
|
154
|
+
onClose: G,
|
|
155
155
|
onSaved: (e) => {
|
|
156
|
-
|
|
156
|
+
R({
|
|
157
157
|
open: !0,
|
|
158
158
|
invoiceId: e
|
|
159
|
-
}),
|
|
159
|
+
}), G(), k?.(e);
|
|
160
160
|
}
|
|
161
161
|
})
|
|
162
162
|
})
|
|
@@ -164,4 +164,4 @@ var y = (e) => /* @__PURE__ */ h(c, { children: /* @__PURE__ */ h(b, { ...e }) }
|
|
|
164
164
|
});
|
|
165
165
|
};
|
|
166
166
|
//#endregion
|
|
167
|
-
export {
|
|
167
|
+
export { _ as Payables };
|
|
@@ -8,15 +8,15 @@ import "../../ui/dist/index.js";
|
|
|
8
8
|
import { COUNTERPART_MESSAGE_LABELS_EN as s } from "./lib/labels.js";
|
|
9
9
|
import { buildAnalyticsMap as c, buildCounterpartRows as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, formatCounterpartDate as f, formatMoney as p, getAchInstructions as m, getCounterpartEmail as h, getCounterpartName as g, getPayableAchInstructions as _, hasAchFormValues as v, hasSelectedText as y, resolveCounterpartBankAccountWrite as b, validateAchFormValues as x } from "./lib/helpers.js";
|
|
10
10
|
import { useCounterpartsQuery as S } from "../../data-access/dist/index3.js";
|
|
11
|
-
import {
|
|
12
|
-
import { useCounterpartAddressesForRowsQuery as
|
|
11
|
+
import { useCounterpartBankAccountsQuery as C, useCreateCounterpartBankAccountMutation as w, useUpdateCounterpartBankAccountMutation as T } from "../../data-access/dist/index5.js";
|
|
12
|
+
import { useCounterpartAddressesForRowsQuery as E, useCounterpartAddressesQuery as D } from "../../data-access/dist/index7.js";
|
|
13
13
|
import "../../data-access/dist/index.js";
|
|
14
|
-
import { useAddressForm as
|
|
15
|
-
import { useCounterpartDetails as
|
|
16
|
-
import { useCounterpartForm as
|
|
14
|
+
import { useAddressForm as O } from "./lib/useAddressForm.js";
|
|
15
|
+
import { useCounterpartDetails as k } from "./lib/useCounterpartDetails.js";
|
|
16
|
+
import { useCounterpartForm as A } from "./lib/useCounterpartForm.js";
|
|
17
17
|
import "./lib/useCounterpartSelector.js";
|
|
18
|
-
import { CounterpartSelector as
|
|
19
|
-
import { useDeleteController as
|
|
18
|
+
import { CounterpartSelector as j } from "./lib/CounterpartSelector.js";
|
|
19
|
+
import { useDeleteController as M } from "./lib/useDeleteController.js";
|
|
20
20
|
import "./lib/useSubEntityForm.js";
|
|
21
|
-
import { useBankAccountForm as
|
|
22
|
-
export { e as AchFieldGroup, a as AddressFormSheet, i as BankAccountFormSheet, s as COUNTERPART_MESSAGE_LABELS_EN, o as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet,
|
|
21
|
+
import { useBankAccountForm as N } from "./lib/subEntityForms.js";
|
|
22
|
+
export { e as AchFieldGroup, a as AddressFormSheet, i as BankAccountFormSheet, s as COUNTERPART_MESSAGE_LABELS_EN, o as ConfirmDeleteDialog, t as CounterpartFormFields, n as CounterpartFormSheet, j as CounterpartSelector, c as buildAnalyticsMap, l as buildCounterpartRows, u as counterpartFormBankAccountToCreatePayload, d as counterpartFormBankAccountToUpdatePayload, f as formatCounterpartDate, p as formatMoney, m as getAchInstructions, h as getCounterpartEmail, g as getCounterpartName, _ as getPayableAchInstructions, v as hasAchFormValues, y as hasSelectedText, b as resolveCounterpartBankAccountWrite, O as useAddressForm, N as useBankAccountForm, E as useCounterpartAddressesForRowsQuery, D as useCounterpartAddressesQuery, C as useCounterpartBankAccountsQuery, k as useCounterpartDetails, A as useCounterpartForm, S as useCounterpartsQuery, w as useCreateCounterpartBankAccountMutation, M as useDeleteController, r as useFocusFirstInvalidField, T as useUpdateCounterpartBankAccountMutation, x as validateAchFormValues };
|
|
@@ -268,14 +268,14 @@ function N(e) {
|
|
|
268
268
|
function P(e) {
|
|
269
269
|
return N(e.bankAccount);
|
|
270
270
|
}
|
|
271
|
-
function F(e) {
|
|
271
|
+
function F(e, t = {}) {
|
|
272
272
|
return {
|
|
273
273
|
account_holder_name: e.accountHolderName.trim() || void 0,
|
|
274
274
|
account_number: e.accountNumber.trim() || void 0,
|
|
275
275
|
routing_number: e.routingNumber.trim() || void 0,
|
|
276
276
|
country: "US",
|
|
277
277
|
currency: "USD",
|
|
278
|
-
is_default_for_currency: !0
|
|
278
|
+
is_default_for_currency: t.isDefaultForCurrency ?? !0
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
function I(e, t = {}) {
|
|
@@ -309,7 +309,10 @@ function R(e, t) {
|
|
|
309
309
|
kind: "update",
|
|
310
310
|
bankAccountId: n.id,
|
|
311
311
|
includeAchDefaults: !0
|
|
312
|
-
} : {
|
|
312
|
+
} : {
|
|
313
|
+
kind: "create",
|
|
314
|
+
isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency)
|
|
315
|
+
};
|
|
313
316
|
}
|
|
314
317
|
function z() {
|
|
315
318
|
return {
|
|
@@ -113,7 +113,7 @@ function D({ view: r, setView: D, selectedId: O, setSelectedId: k, messages: A,
|
|
|
113
113
|
body: a(U.bankAccount, { includeAchDefaults: r.includeAchDefaults })
|
|
114
114
|
}) : r?.kind === "create" ? z.mutateAsync({
|
|
115
115
|
path: { counterpart_id: O },
|
|
116
|
-
body: i(U.bankAccount)
|
|
116
|
+
body: i(U.bankAccount, { isDefaultForCurrency: r.isDefaultForCurrency })
|
|
117
117
|
}) : void 0, [c, l] = await Promise.allSettled([e, o]);
|
|
118
118
|
if (r?.kind === "create" && l.status === "fulfilled" && X(l.value?.id), c.status === "rejected") throw c.reason;
|
|
119
119
|
if (l.status === "rejected") throw l.reason;
|