@mercurjs/admin 2.4.1 → 2.4.2-canary.1
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/{adjust-inventory-HCWOMJAV.js → adjust-inventory-VN7VTEHC.js} +1 -1
- package/dist/{api-key-management-detail-D2GM6B6T.js → api-key-management-detail-QPIDG4YL.js} +1 -1
- package/dist/{attribute-create-K7TPMERV.js → attribute-create-KXP2BR3A.js} +1 -1
- package/dist/{attribute-detail-LB7SMSUV.js → attribute-detail-EXGOXBSF.js} +1 -1
- package/dist/{attribute-list-3PNFEKNK.js → attribute-list-YGW7T57X.js} +1 -1
- package/dist/{campaign-detail-WDXCECLJ.js → campaign-detail-CQLFD5TR.js} +1 -1
- package/dist/{categories-metadata-4F2CFSXD.js → categories-metadata-5WRCUAYB.js} +1 -1
- package/dist/{category-detail-6BSP4F34.js → category-detail-XYXPRDG6.js} +1 -1
- package/dist/{category-products-6JWUKWLH.js → category-products-AE44IYFB.js} +1 -1
- package/dist/{chunk-EB4AEE5K.js → chunk-3XDYPQNV.js} +40 -37
- package/dist/{chunk-FOQIQUOW.js → chunk-42V46GPL.js} +1 -1
- package/dist/{chunk-47SMVPF4.js → chunk-EIWJM2EG.js} +1 -1
- package/dist/{chunk-HU6Z5HMO.js → chunk-H77B5JE2.js} +1 -1
- package/dist/{chunk-5OYCQHBX.js → chunk-PQ6UCU26.js} +5 -4
- package/dist/{chunk-FP6AGRMB.js → chunk-Q25CKL6P.js} +78 -26
- package/dist/{collection-add-products-QF4ODQKF.js → collection-add-products-YGSJTBLG.js} +1 -1
- package/dist/{collection-detail-NBOFITIU.js → collection-detail-SA3GXCYV.js} +1 -1
- package/dist/{collection-list-7LTCCKRK.js → collection-list-T7LIHCSO.js} +1 -1
- package/dist/{collection-metadata-BZSIYBDF.js → collection-metadata-D56TMA2O.js} +1 -1
- package/dist/{commission-rule-commission-edit-3QPNHX5T.js → commission-rule-commission-edit-CQEL6X4K.js} +25 -9
- package/dist/{commission-rule-create-ZIXZWIHV.js → commission-rule-create-TIBT26QY.js} +35 -12
- package/dist/{commission-rule-detail-6K5ZAF7H.js → commission-rule-detail-KXOBJ7ZE.js} +4 -3
- package/dist/{commission-rule-edit-5EOJ5LUY.js → commission-rule-edit-YJXOOLIR.js} +28 -10
- package/dist/{commissions-list-G4VHOTSN.js → commissions-list-NOHWTAL6.js} +4 -3
- package/dist/{customer-detail-QVCK3IQG.js → customer-detail-X4QO7R4I.js} +1 -1
- package/dist/{customer-group-detail-I2JJM7DG.js → customer-group-detail-5SI2UEWT.js} +1 -1
- package/dist/{customer-group-list-PUUJ7MM2.js → customer-group-list-W6AAEMJZ.js} +1 -1
- package/dist/{customer-group-metadata-XXOBH3L2.js → customer-group-metadata-ZULCBXZT.js} +1 -1
- package/dist/{customer-metadata-SAW62KGI.js → customer-metadata-PX4675YG.js} +1 -1
- package/dist/{customers-add-customer-group-BHXFYVLH.js → customers-add-customer-group-MRUPG2NL.js} +1 -1
- package/dist/{edit-inventory-item-2DLVVIJ4.js → edit-inventory-item-E4HTJCLW.js} +1 -1
- package/dist/{edit-inventory-item-attributes-RQZEKOXP.js → edit-inventory-item-attributes-DTFCKHA3.js} +1 -1
- package/dist/{edit-rules-JPACO35R.js → edit-rules-D2ETXYOG.js} +1 -1
- package/dist/extension-targets.d.ts +9 -0
- package/dist/{global-commission-edit-UKMZZA22.js → global-commission-edit-RPDJHLOU.js} +25 -9
- package/dist/{home-QFVMESEG.js → home-4IJKX3FC.js} +2 -2
- package/dist/index.js +133 -131
- package/dist/{inventory-detail-OXM2U25Q.js → inventory-detail-2QWJSRLT.js} +1 -1
- package/dist/{inventory-metadata-4NHI7KVC.js → inventory-metadata-ZOFBU2CS.js} +1 -1
- package/dist/{inventory-stock-BN4RQN34.js → inventory-stock-2KPY45VX.js} +1 -1
- package/dist/{location-detail-QISQPJ2S.js → location-detail-CQFXKIW2.js} +1 -1
- package/dist/{location-fulfillment-providers-DESFXOLB.js → location-fulfillment-providers-K3IF56D3.js} +1 -1
- package/dist/{location-list-7GZTMS6Z.js → location-list-CVMIBMT7.js} +1 -1
- package/dist/{location-service-zone-shipping-option-create-LMCLZHW5.js → location-service-zone-shipping-option-create-RL7Q7P3U.js} +1 -1
- package/dist/{login-TZCKYLS2.js → login-GB4TZ3KN.js} +1 -1
- package/dist/{marketplace-detail-TQCKYRBS.js → marketplace-detail-BGGEDBMZ.js} +1 -1
- package/dist/{marketplace-metadata-Z3UFWZUC.js → marketplace-metadata-AV4IYMSI.js} +1 -1
- package/dist/{offer-condition-create-JCDGQFLY.js → offer-condition-create-ELOPMTVF.js} +1 -1
- package/dist/{offer-condition-edit-Y32ODIVM.js → offer-condition-edit-X47KO53G.js} +1 -1
- package/dist/{offer-condition-list-Q4SGJ5ER.js → offer-condition-list-F2UTHYW5.js} +1 -1
- package/dist/{offers-EPZHPNYY.js → offers-BCT5ZNVV.js} +1 -1
- package/dist/{order-create-exchange-W5FBNAZ4.js → order-create-exchange-BJK7VBZJ.js} +1 -1
- package/dist/{order-create-refund-OSD76IHC.js → order-create-refund-HCWHO7UA.js} +1 -1
- package/dist/{order-detail-ECCZ6PVH.js → order-detail-UGTEV6YA.js} +1 -1
- package/dist/{order-edit-billing-address-S62PLHKI.js → order-edit-billing-address-L7OB7DT4.js} +1 -1
- package/dist/{order-edit-email-43XUEGOW.js → order-edit-email-6W3ZFJP3.js} +1 -1
- package/dist/{order-edit-shipping-address-VNJ3DEDC.js → order-edit-shipping-address-EAN3RL44.js} +1 -1
- package/dist/{order-metadata-S7P77GAB.js → order-metadata-H55SOYPV.js} +1 -1
- package/dist/{order-request-transfer-Y3DJEWCH.js → order-request-transfer-5Z5ASYLA.js} +1 -1
- package/dist/pages/index.js +4 -4
- package/dist/{price-list-create-DKIPNI7N.js → price-list-create-MZBAANRE.js} +1 -1
- package/dist/{price-list-detail-24JSV6DP.js → price-list-detail-GHBU34II.js} +1 -1
- package/dist/{price-list-prices-add-H4U7R42B.js → price-list-prices-add-PU3QIZ6C.js} +1 -1
- package/dist/{price-list-prices-edit-6PXRI6VE.js → price-list-prices-edit-U5JMSZR2.js} +1 -1
- package/dist/{product-add-existing-attributes-BPU2Z6KR.js → product-add-existing-attributes-BUPTMRVD.js} +1 -1
- package/dist/{product-create-5OOPORPD.js → product-create-W3RUAYN2.js} +1 -1
- package/dist/{product-detail-3LUXR2LK.js → product-detail-56VBJ5BZ.js} +1 -1
- package/dist/{product-list-KSOPIKZZ.js → product-list-UTRXPARK.js} +1 -1
- package/dist/{product-metadata-ZN2Z4THR.js → product-metadata-Y3M4ZZ2H.js} +1 -1
- package/dist/{product-tag-create-2RC7QI4R.js → product-tag-create-GNJTKAUY.js} +1 -1
- package/dist/{product-tag-detail-AUWXAVV5.js → product-tag-detail-PWYCRCC3.js} +1 -1
- package/dist/{product-tag-edit-J4QQIFOP.js → product-tag-edit-IEYXMMU3.js} +1 -1
- package/dist/{product-tag-list-SAWEXU6Y.js → product-tag-list-LNKN323U.js} +1 -1
- package/dist/{product-tag-metadata-XFPUJJQK.js → product-tag-metadata-Q4JIK46H.js} +1 -1
- package/dist/{product-type-detail-BYBH6FU5.js → product-type-detail-7P2M7JIS.js} +1 -1
- package/dist/{product-type-metadata-LTKMPGZG.js → product-type-metadata-S7ZPZFPU.js} +1 -1
- package/dist/{product-variant-detail-QSIMMPAS.js → product-variant-detail-K5L2YBZ5.js} +1 -1
- package/dist/{product-variant-edit-GCNHVA66.js → product-variant-edit-2A6AJ74P.js} +1 -1
- package/dist/{product-variant-metadata-RPUU24N6.js → product-variant-metadata-DNMZY323.js} +1 -1
- package/dist/{promotion-create-I7DRFZHS.js → promotion-create-6Q2ZXHUG.js} +1 -1
- package/dist/{promotion-detail-UHTA7TW4.js → promotion-detail-QYNXRGMO.js} +1 -1
- package/dist/{refund-reason-create-LHS575LW.js → refund-reason-create-25ZABWC3.js} +1 -1
- package/dist/{refund-reason-edit-C4VW2HFG.js → refund-reason-edit-5DZPMYVZ.js} +1 -1
- package/dist/{refund-reason-list-2MWIMSAT.js → refund-reason-list-YJN3YBCX.js} +1 -1
- package/dist/{region-metadata-JFMEKJKX.js → region-metadata-R6S3KUOD.js} +1 -1
- package/dist/{reservation-detail-UW76ZPR4.js → reservation-detail-FCLXXM7P.js} +1 -1
- package/dist/{reservation-metadata-RWKUHPTL.js → reservation-metadata-35N7FCGC.js} +1 -1
- package/dist/{sales-channel-add-products-3Z4H2LBG.js → sales-channel-add-products-XSGA433D.js} +1 -1
- package/dist/{sales-channel-detail-W6DH33UU.js → sales-channel-detail-WUA6WCD3.js} +1 -1
- package/dist/{sales-channel-list-SM56SL3Q.js → sales-channel-list-OA3BS44A.js} +1 -1
- package/dist/{sales-channel-metadata-5J3LEVDW.js → sales-channel-metadata-EQEMA7ZK.js} +1 -1
- package/dist/{settings-BYCHWQZP.js → settings-AWR2IXVU.js} +3 -3
- package/dist/{shipping-option-type-create-K5J6N6OO.js → shipping-option-type-create-JNVJYWQ4.js} +1 -1
- package/dist/{shipping-option-type-detail-5OD7PUYU.js → shipping-option-type-detail-FWMONUZX.js} +1 -1
- package/dist/{shipping-option-type-edit-65TVRSX4.js → shipping-option-type-edit-2ORVYAS2.js} +1 -1
- package/dist/{shipping-option-type-list-RXBWNCTF.js → shipping-option-type-list-XOC4A2K5.js} +1 -1
- package/dist/{shipping-profile-metadata-7D56WKNO.js → shipping-profile-metadata-TQJUPQDT.js} +1 -1
- package/dist/{store-create-FDBL3NJ5.js → store-create-XODKGAQB.js} +1 -1
- package/dist/{store-details-N7LSB242.js → store-details-CTXOMJ4F.js} +1 -1
- package/dist/{store-list-RKHROB2P.js → store-list-MSXINJBB.js} +1 -1
- package/dist/{tax-region-create-A4ZIEXOC.js → tax-region-create-27DNVEWH.js} +1 -1
- package/dist/{tax-region-detail-QOXPUIGD.js → tax-region-detail-TL34TZ74.js} +1 -1
- package/dist/{tax-region-edit-7OOWJR7E.js → tax-region-edit-WMTF547K.js} +1 -1
- package/dist/{tax-region-metadata-NU24NL4X.js → tax-region-metadata-XTERQTSO.js} +1 -1
- package/dist/{tax-region-province-detail-656A6ITD.js → tax-region-province-detail-V4O4LIEL.js} +1 -1
- package/dist/{tax-region-tax-override-create-JVNMHUJH.js → tax-region-tax-override-create-MGQYCSLB.js} +1 -1
- package/dist/{tax-region-tax-override-edit-CXDK225Q.js → tax-region-tax-override-edit-PWH2ZJVM.js} +1 -1
- package/dist/{user-metadata-Z63EDSGF.js → user-metadata-P4XDYLXJ.js} +1 -1
- package/package.json +6 -6
|
@@ -11,7 +11,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
11
11
|
import "./chunk-7DEZJGI6.js";
|
|
12
12
|
import "./chunk-H5G6SVUG.js";
|
|
13
13
|
import "./chunk-TOAE7XZ7.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-H77B5JE2.js";
|
|
15
15
|
import "./chunk-6ZQXTLI7.js";
|
|
16
16
|
import "./chunk-ZVOBDGMH.js";
|
|
17
17
|
import "./chunk-3EPP7VXZ.js";
|
package/dist/{api-key-management-detail-D2GM6B6T.js → api-key-management-detail-QPIDG4YL.js}
RENAMED
|
@@ -22,7 +22,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
22
22
|
import "./chunk-7DEZJGI6.js";
|
|
23
23
|
import "./chunk-H5G6SVUG.js";
|
|
24
24
|
import "./chunk-TOAE7XZ7.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-H77B5JE2.js";
|
|
26
26
|
import "./chunk-6ZQXTLI7.js";
|
|
27
27
|
import "./chunk-ZVOBDGMH.js";
|
|
28
28
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -30,7 +30,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
30
30
|
import "./chunk-7DEZJGI6.js";
|
|
31
31
|
import "./chunk-H5G6SVUG.js";
|
|
32
32
|
import "./chunk-TOAE7XZ7.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-H77B5JE2.js";
|
|
34
34
|
import "./chunk-6ZQXTLI7.js";
|
|
35
35
|
import "./chunk-ZVOBDGMH.js";
|
|
36
36
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -22,7 +22,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
22
22
|
import "./chunk-7DEZJGI6.js";
|
|
23
23
|
import "./chunk-H5G6SVUG.js";
|
|
24
24
|
import "./chunk-TOAE7XZ7.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-H77B5JE2.js";
|
|
26
26
|
import "./chunk-6ZQXTLI7.js";
|
|
27
27
|
import "./chunk-ZVOBDGMH.js";
|
|
28
28
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -19,7 +19,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
19
19
|
import "./chunk-7DEZJGI6.js";
|
|
20
20
|
import "./chunk-H5G6SVUG.js";
|
|
21
21
|
import "./chunk-TOAE7XZ7.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-H77B5JE2.js";
|
|
23
23
|
import "./chunk-6ZQXTLI7.js";
|
|
24
24
|
import "./chunk-ZVOBDGMH.js";
|
|
25
25
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -25,7 +25,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
25
25
|
import "./chunk-7DEZJGI6.js";
|
|
26
26
|
import "./chunk-H5G6SVUG.js";
|
|
27
27
|
import "./chunk-TOAE7XZ7.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-H77B5JE2.js";
|
|
29
29
|
import "./chunk-6ZQXTLI7.js";
|
|
30
30
|
import "./chunk-ZVOBDGMH.js";
|
|
31
31
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -12,7 +12,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
12
12
|
import "./chunk-7DEZJGI6.js";
|
|
13
13
|
import "./chunk-H5G6SVUG.js";
|
|
14
14
|
import "./chunk-TOAE7XZ7.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-H77B5JE2.js";
|
|
16
16
|
import "./chunk-6ZQXTLI7.js";
|
|
17
17
|
import "./chunk-ZVOBDGMH.js";
|
|
18
18
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -28,7 +28,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
28
28
|
import "./chunk-7DEZJGI6.js";
|
|
29
29
|
import "./chunk-H5G6SVUG.js";
|
|
30
30
|
import "./chunk-TOAE7XZ7.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-H77B5JE2.js";
|
|
32
32
|
import "./chunk-6ZQXTLI7.js";
|
|
33
33
|
import "./chunk-ZVOBDGMH.js";
|
|
34
34
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -23,7 +23,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
23
23
|
import "./chunk-7DEZJGI6.js";
|
|
24
24
|
import "./chunk-H5G6SVUG.js";
|
|
25
25
|
import "./chunk-TOAE7XZ7.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-H77B5JE2.js";
|
|
27
27
|
import "./chunk-6ZQXTLI7.js";
|
|
28
28
|
import "./chunk-ZVOBDGMH.js";
|
|
29
29
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDeleteCommissionRuleAction,
|
|
3
3
|
useScopeReferenceNames
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q25CKL6P.js";
|
|
5
5
|
import {
|
|
6
6
|
formatCommissionValue,
|
|
7
7
|
getIsActiveProps,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
useCommissionRules,
|
|
29
29
|
useDefaultCommission
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-H77B5JE2.js";
|
|
31
31
|
import {
|
|
32
32
|
useQueryParams
|
|
33
33
|
} from "./chunk-THHRRYRS.js";
|
|
@@ -206,7 +206,7 @@ var useCommissionRulesQuery = ({
|
|
|
206
206
|
};
|
|
207
207
|
|
|
208
208
|
// src/pages/commissions/commissions-list/components/commission-rules-table/commission-rules-data-table.tsx
|
|
209
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
209
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
210
210
|
var PAGE_SIZE = 20;
|
|
211
211
|
var CommissionRulesDataTable = () => {
|
|
212
212
|
const { t } = useTranslation3();
|
|
@@ -276,34 +276,37 @@ var CommissionRulesDataTable = () => {
|
|
|
276
276
|
};
|
|
277
277
|
var CommissionRuleRowActions = ({ rule }) => {
|
|
278
278
|
const { t } = useTranslation3();
|
|
279
|
-
const handleDelete = useDeleteCommissionRuleAction(rule);
|
|
280
|
-
return /* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
279
|
+
const { handleDelete, deleteDialog } = useDeleteCommissionRuleAction(rule);
|
|
280
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
281
|
+
/* @__PURE__ */ jsx2(
|
|
282
|
+
ActionMenu,
|
|
283
|
+
{
|
|
284
|
+
groups: [
|
|
285
|
+
{
|
|
286
|
+
actions: [
|
|
287
|
+
{
|
|
288
|
+
permission: "commission_rates:edit",
|
|
289
|
+
label: t("actions.edit"),
|
|
290
|
+
to: `/settings/commissions/${rule.id}/edit`,
|
|
291
|
+
icon: /* @__PURE__ */ jsx2(PencilSquare2, {})
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
actions: [
|
|
297
|
+
{
|
|
298
|
+
permission: "commission_rates:manage",
|
|
299
|
+
label: t("actions.delete"),
|
|
300
|
+
onClick: handleDelete,
|
|
301
|
+
icon: /* @__PURE__ */ jsx2(Trash, {})
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
deleteDialog
|
|
309
|
+
] });
|
|
307
310
|
};
|
|
308
311
|
var columnHelper = createColumnHelper();
|
|
309
312
|
var useColumns = (names) => {
|
|
@@ -350,28 +353,28 @@ import { Button, Heading as Heading2 } from "@medusajs/ui";
|
|
|
350
353
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
351
354
|
import { PermissionGuard } from "@mercurjs/dashboard-shared";
|
|
352
355
|
import { Link } from "react-router-dom";
|
|
353
|
-
import { jsx as jsx3, jsxs as
|
|
356
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
354
357
|
var CommissionRulesHeader = () => {
|
|
355
358
|
const { t } = useTranslation4();
|
|
356
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
357
360
|
/* @__PURE__ */ jsx3(Heading2, { children: t("commissions.rules.title") }),
|
|
358
361
|
/* @__PURE__ */ jsx3(PermissionGuard, { permission: "commission_rates:edit", children: /* @__PURE__ */ jsx3(Button, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx3(Link, { to: "create", children: t("actions.create") }) }) })
|
|
359
362
|
] });
|
|
360
363
|
};
|
|
361
364
|
|
|
362
365
|
// src/pages/commissions/commissions-list/components/commission-rules-table/commission-rules-table.tsx
|
|
363
|
-
import { jsx as jsx4, jsxs as
|
|
366
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
364
367
|
var CommissionRulesTable = () => {
|
|
365
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ jsxs4(Container2, { className: "divide-y p-0", children: [
|
|
366
369
|
/* @__PURE__ */ jsx4(CommissionRulesHeader, {}),
|
|
367
370
|
/* @__PURE__ */ jsx4(CommissionRulesDataTable, {})
|
|
368
371
|
] });
|
|
369
372
|
};
|
|
370
373
|
|
|
371
374
|
// src/pages/commissions/commissions-list/commissions-page.tsx
|
|
372
|
-
import { Fragment as
|
|
375
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
373
376
|
var Root = ({ children }) => {
|
|
374
|
-
return /* @__PURE__ */ jsx5(SingleColumnPage, { hasOutlet: true, "data-testid": "commissions-page", children: /* @__PURE__ */ jsx5(WidgetZone, { id: "commissions.list", children: Children.count(children) > 0 ? children : /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ jsx5(SingleColumnPage, { hasOutlet: true, "data-testid": "commissions-page", children: /* @__PURE__ */ jsx5(WidgetZone, { id: "commissions.list", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
375
378
|
/* @__PURE__ */ jsx5(GlobalCommissionSection, {}),
|
|
376
379
|
/* @__PURE__ */ jsx5(CommissionRulesTable, {})
|
|
377
380
|
] }) }) });
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getMenuItemsByType,
|
|
8
8
|
useExpandedSidebar,
|
|
9
9
|
useLandingRoute
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EIWJM2EG.js";
|
|
11
11
|
|
|
12
12
|
// src/components/layout/settings-layout/settings-layout.tsx
|
|
13
13
|
import { Fragment, useCallback, useEffect, useMemo, useState } from "react";
|
|
@@ -66,7 +66,7 @@ var useUpdateCommissionRule = (id, options) => {
|
|
|
66
66
|
};
|
|
67
67
|
var useDeleteCommissionRule = (id, options) => {
|
|
68
68
|
return useMutation({
|
|
69
|
-
mutationFn: () => sdk.admin.commissionRates.$id.delete({ $id: id }),
|
|
69
|
+
mutationFn: (payload) => sdk.admin.commissionRates.$id.delete({ $id: id, ...payload }),
|
|
70
70
|
onSuccess: (data, variables, context) => {
|
|
71
71
|
queryClient.invalidateQueries({
|
|
72
72
|
queryKey: commissionsQueryKeys.detail(id)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDeleteCommissionRuleAction,
|
|
3
3
|
useScopeReferenceNames
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q25CKL6P.js";
|
|
5
5
|
import {
|
|
6
6
|
formatCommissionValue,
|
|
7
7
|
getIsActiveProps,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-3UOYBH5O.js";
|
|
21
21
|
import {
|
|
22
22
|
useCommissionRule
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-H77B5JE2.js";
|
|
24
24
|
|
|
25
25
|
// src/pages/commissions/commission-rule-detail/commission-rule-detail.tsx
|
|
26
26
|
import { PencilSquare, Trash } from "@medusajs/icons";
|
|
@@ -31,7 +31,7 @@ import { WidgetZone } from "@mercurjs/dashboard-shared";
|
|
|
31
31
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
32
|
var ScopeSection = ({ rule }) => {
|
|
33
33
|
const { t } = useTranslation();
|
|
34
|
-
const handleDelete = useDeleteCommissionRuleAction(rule);
|
|
34
|
+
const { handleDelete, deleteDialog } = useDeleteCommissionRuleAction(rule);
|
|
35
35
|
const statusProps = getIsActiveProps(rule.is_enabled, t);
|
|
36
36
|
const { names } = useScopeReferenceNames(rule.rules);
|
|
37
37
|
const stores = referenceIds(rule.rules, "seller");
|
|
@@ -68,7 +68,8 @@ var ScopeSection = ({ rule }) => {
|
|
|
68
68
|
}
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
|
-
)
|
|
71
|
+
),
|
|
72
|
+
deleteDialog
|
|
72
73
|
] })
|
|
73
74
|
] }),
|
|
74
75
|
/* @__PURE__ */ jsx(
|
|
@@ -3,48 +3,100 @@ import {
|
|
|
3
3
|
} from "./chunk-TOAE7XZ7.js";
|
|
4
4
|
import {
|
|
5
5
|
useDeleteCommissionRule
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-H77B5JE2.js";
|
|
7
7
|
import {
|
|
8
8
|
useProductCategories
|
|
9
9
|
} from "./chunk-YP2DOA53.js";
|
|
10
10
|
import {
|
|
11
11
|
useSellers
|
|
12
12
|
} from "./chunk-6W57K3PC.js";
|
|
13
|
+
import {
|
|
14
|
+
Form
|
|
15
|
+
} from "./chunk-3QSRE5LS.js";
|
|
13
16
|
|
|
14
17
|
// src/pages/commissions/common/hooks/use-delete-commission-rule-action.tsx
|
|
15
|
-
import {
|
|
18
|
+
import { Prompt, toast } from "@medusajs/ui";
|
|
19
|
+
import {
|
|
20
|
+
FormExtensionZone,
|
|
21
|
+
useExtendableForm,
|
|
22
|
+
useExtension
|
|
23
|
+
} from "@mercurjs/dashboard-shared";
|
|
24
|
+
import { useState } from "react";
|
|
16
25
|
import { useTranslation } from "react-i18next";
|
|
17
26
|
import { useNavigate } from "react-router-dom";
|
|
27
|
+
import * as zod from "zod";
|
|
28
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
var DeleteCommissionRuleSchema = zod.object({});
|
|
18
30
|
var useDeleteCommissionRuleAction = (rule) => {
|
|
19
31
|
const { t } = useTranslation();
|
|
20
|
-
const prompt = usePrompt();
|
|
21
32
|
const navigate = useNavigate();
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (
|
|
33
|
+
const [open, setOpen] = useState(false);
|
|
34
|
+
const { mutateAsync, isPending } = useDeleteCommissionRule(rule.id);
|
|
35
|
+
const hasCustomFields = useExtension().getFormFields("commission_rate", "delete").length > 0;
|
|
36
|
+
const form = useExtendableForm({
|
|
37
|
+
schema: DeleteCommissionRuleSchema,
|
|
38
|
+
model: "commission_rate",
|
|
39
|
+
zone: "delete",
|
|
40
|
+
data: rule,
|
|
41
|
+
defaultValues: {}
|
|
42
|
+
});
|
|
43
|
+
const handleOpenChange = (next) => {
|
|
44
|
+
if (isPending) {
|
|
34
45
|
return;
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
41
|
-
navigate("/settings/commissions");
|
|
42
|
-
},
|
|
43
|
-
onError: (e) => {
|
|
44
|
-
toast.error(e.message);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
+
if (next) {
|
|
48
|
+
form.reset();
|
|
49
|
+
}
|
|
50
|
+
setOpen(next);
|
|
47
51
|
};
|
|
52
|
+
const handleSubmit = form.handleSubmit(async (values) => {
|
|
53
|
+
await mutateAsync(
|
|
54
|
+
{ additional_data: values.additional_data },
|
|
55
|
+
{
|
|
56
|
+
onSuccess: () => {
|
|
57
|
+
toast.success(t("commissions.delete.successToast"));
|
|
58
|
+
setOpen(false);
|
|
59
|
+
navigate("/settings/commissions");
|
|
60
|
+
},
|
|
61
|
+
onError: (e) => {
|
|
62
|
+
toast.error(e.message);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
const deleteDialog = /* @__PURE__ */ jsx(Prompt, { open, onOpenChange: handleOpenChange, variant: "danger", children: /* @__PURE__ */ jsx(Prompt.Content, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxs(Form, { ...form, children: [
|
|
68
|
+
/* @__PURE__ */ jsxs(Prompt.Header, { className: hasCustomFields ? "pb-6" : void 0, children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Prompt.Title, { children: t("commissions.delete.title") }),
|
|
70
|
+
/* @__PURE__ */ jsx(Prompt.Description, { children: t("commissions.delete.description", {
|
|
71
|
+
name: rule.name,
|
|
72
|
+
defaultValue: `You are about to delete commission rule ${rule.name}. This action cannot be undone.`
|
|
73
|
+
}) })
|
|
74
|
+
] }),
|
|
75
|
+
hasCustomFields ? /* @__PURE__ */ jsx("div", { className: "border-ui-border-base border-y px-6 py-4", children: /* @__PURE__ */ jsx(
|
|
76
|
+
FormExtensionZone,
|
|
77
|
+
{
|
|
78
|
+
model: "commission_rate",
|
|
79
|
+
zone: "delete",
|
|
80
|
+
control: form.control,
|
|
81
|
+
data: rule
|
|
82
|
+
}
|
|
83
|
+
) }) : null,
|
|
84
|
+
/* @__PURE__ */ jsxs(Prompt.Footer, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(Prompt.Cancel, { disabled: isPending, children: t("actions.cancel") }),
|
|
86
|
+
/* @__PURE__ */ jsx(
|
|
87
|
+
Prompt.Action,
|
|
88
|
+
{
|
|
89
|
+
onClick: (e) => {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
void handleSubmit();
|
|
92
|
+
},
|
|
93
|
+
disabled: isPending,
|
|
94
|
+
children: t("actions.delete")
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] })
|
|
98
|
+
] }) }) });
|
|
99
|
+
return { handleDelete: () => handleOpenChange(true), deleteDialog };
|
|
48
100
|
};
|
|
49
101
|
|
|
50
102
|
// src/pages/commissions/common/hooks/use-scope-reference-names.tsx
|
|
@@ -23,7 +23,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
23
23
|
import "./chunk-7DEZJGI6.js";
|
|
24
24
|
import "./chunk-H5G6SVUG.js";
|
|
25
25
|
import "./chunk-TOAE7XZ7.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-H77B5JE2.js";
|
|
27
27
|
import "./chunk-6ZQXTLI7.js";
|
|
28
28
|
import "./chunk-ZVOBDGMH.js";
|
|
29
29
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -25,7 +25,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
25
25
|
import "./chunk-7DEZJGI6.js";
|
|
26
26
|
import "./chunk-H5G6SVUG.js";
|
|
27
27
|
import "./chunk-TOAE7XZ7.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-H77B5JE2.js";
|
|
29
29
|
import "./chunk-6ZQXTLI7.js";
|
|
30
30
|
import "./chunk-ZVOBDGMH.js";
|
|
31
31
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -43,7 +43,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
43
43
|
import "./chunk-7DEZJGI6.js";
|
|
44
44
|
import "./chunk-H5G6SVUG.js";
|
|
45
45
|
import "./chunk-TOAE7XZ7.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-H77B5JE2.js";
|
|
47
47
|
import "./chunk-6ZQXTLI7.js";
|
|
48
48
|
import "./chunk-ZVOBDGMH.js";
|
|
49
49
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -11,7 +11,7 @@ import "./chunk-ZPNDXVKU.js";
|
|
|
11
11
|
import "./chunk-7DEZJGI6.js";
|
|
12
12
|
import "./chunk-H5G6SVUG.js";
|
|
13
13
|
import "./chunk-TOAE7XZ7.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-H77B5JE2.js";
|
|
15
15
|
import "./chunk-6ZQXTLI7.js";
|
|
16
16
|
import "./chunk-ZVOBDGMH.js";
|
|
17
17
|
import "./chunk-3EPP7VXZ.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
useCommissionRule,
|
|
20
20
|
useUpdateCommissionRule
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-H77B5JE2.js";
|
|
22
22
|
import "./chunk-CYRBIZLI.js";
|
|
23
23
|
import "./chunk-J6FNB3IE.js";
|
|
24
24
|
import "./chunk-IQPN4PZJ.js";
|
|
@@ -38,10 +38,12 @@ import "./chunk-PFJ2C667.js";
|
|
|
38
38
|
import "./chunk-NBMM2TZK.js";
|
|
39
39
|
|
|
40
40
|
// src/pages/commissions/commission-rule-commission-edit/commission-rule-commission-edit.tsx
|
|
41
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
42
41
|
import { Button, Heading, toast } from "@medusajs/ui";
|
|
42
|
+
import {
|
|
43
|
+
FormExtensionZone,
|
|
44
|
+
useExtendableForm
|
|
45
|
+
} from "@mercurjs/dashboard-shared";
|
|
43
46
|
import { useMemo } from "react";
|
|
44
|
-
import { useForm } from "react-hook-form";
|
|
45
47
|
import { useTranslation } from "react-i18next";
|
|
46
48
|
import { useParams } from "react-router-dom";
|
|
47
49
|
import * as zod from "zod";
|
|
@@ -69,19 +71,23 @@ var EditCommissionForm = ({ rule }) => {
|
|
|
69
71
|
{ value: "percentage", label: t("commissions.fields.type.percentage") },
|
|
70
72
|
{ value: "fixed", label: t("commissions.fields.type.fixed") }
|
|
71
73
|
];
|
|
72
|
-
const
|
|
73
|
-
() =>
|
|
74
|
+
const schema = useMemo(
|
|
75
|
+
() => createEditCommissionSchema(currencies),
|
|
74
76
|
[currencies]
|
|
75
77
|
);
|
|
76
|
-
const form =
|
|
78
|
+
const form = useExtendableForm({
|
|
79
|
+
// Refined schemas are merged by intersection inside useExtendableForm.
|
|
80
|
+
schema,
|
|
81
|
+
model: "commission_rate",
|
|
82
|
+
zone: "edit-value",
|
|
83
|
+
data: rule,
|
|
77
84
|
defaultValues: {
|
|
78
85
|
type: rule.type,
|
|
79
86
|
value: rule.value,
|
|
80
87
|
fixed_values: fixedValuesFromRate(rule),
|
|
81
88
|
include_tax: rule.include_tax,
|
|
82
89
|
include_shipping: rule.include_shipping
|
|
83
|
-
}
|
|
84
|
-
resolver
|
|
90
|
+
}
|
|
85
91
|
});
|
|
86
92
|
const { mutateAsync, isPending } = useUpdateCommissionRule(rule.id);
|
|
87
93
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
@@ -92,7 +98,8 @@ var EditCommissionForm = ({ rule }) => {
|
|
|
92
98
|
value: isFixed ? 0 : values.value,
|
|
93
99
|
...isFixed ? { values: buildValuesPayload(currencies, values.fixed_values) } : {},
|
|
94
100
|
include_tax: values.include_tax,
|
|
95
|
-
include_shipping: values.include_shipping
|
|
101
|
+
include_shipping: values.include_shipping,
|
|
102
|
+
additional_data: values.additional_data
|
|
96
103
|
},
|
|
97
104
|
{
|
|
98
105
|
onSuccess: () => {
|
|
@@ -153,6 +160,15 @@ var EditCommissionForm = ({ rule }) => {
|
|
|
153
160
|
label: t("commissions.fields.shippingIncluded"),
|
|
154
161
|
description: t("commissions.fields.shippingIncludedHint")
|
|
155
162
|
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsx(
|
|
165
|
+
FormExtensionZone,
|
|
166
|
+
{
|
|
167
|
+
model: "commission_rate",
|
|
168
|
+
zone: "edit-value",
|
|
169
|
+
control: form.control,
|
|
170
|
+
data: rule
|
|
171
|
+
}
|
|
156
172
|
)
|
|
157
173
|
] }) }),
|
|
158
174
|
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "./chunk-2EME4AWX.js";
|
|
29
29
|
import {
|
|
30
30
|
useCreateCommissionRule
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-H77B5JE2.js";
|
|
32
32
|
import "./chunk-CYRBIZLI.js";
|
|
33
33
|
import "./chunk-J6FNB3IE.js";
|
|
34
34
|
import "./chunk-IQPN4PZJ.js";
|
|
@@ -55,14 +55,14 @@ import { Children } from "react";
|
|
|
55
55
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
56
56
|
|
|
57
57
|
// src/pages/commissions/commission-rule-create/components/create-commission-rule-form/create-commission-rule-form.tsx
|
|
58
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
59
58
|
import { toast } from "@medusajs/ui";
|
|
59
|
+
import { useExtendableForm } from "@mercurjs/dashboard-shared";
|
|
60
60
|
import { useMemo } from "react";
|
|
61
|
-
import { useForm } from "react-hook-form";
|
|
62
61
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
63
62
|
|
|
64
63
|
// src/pages/commissions/commission-rule-create/components/create-commission-rule-form/create-commission-rule-commission.tsx
|
|
65
64
|
import { Heading } from "@medusajs/ui";
|
|
65
|
+
import { FormExtensionZone } from "@mercurjs/dashboard-shared";
|
|
66
66
|
import { useTranslation } from "react-i18next";
|
|
67
67
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
68
68
|
var CreateCommissionRuleCommission = () => {
|
|
@@ -125,7 +125,17 @@ var CreateCommissionRuleCommission = () => {
|
|
|
125
125
|
description: t("commissions.fields.shippingIncludedHint")
|
|
126
126
|
}
|
|
127
127
|
)
|
|
128
|
-
] })
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
FormExtensionZone,
|
|
131
|
+
{
|
|
132
|
+
model: "commission_rate",
|
|
133
|
+
zone: "create",
|
|
134
|
+
tab: "commission",
|
|
135
|
+
exactTab: true,
|
|
136
|
+
control: form.control
|
|
137
|
+
}
|
|
138
|
+
)
|
|
129
139
|
] }) });
|
|
130
140
|
};
|
|
131
141
|
CreateCommissionRuleCommission._tabMeta = defineTabMeta({
|
|
@@ -137,7 +147,7 @@ CreateCommissionRuleCommission._tabMeta = defineTabMeta({
|
|
|
137
147
|
// src/pages/commissions/commission-rule-create/components/create-commission-rule-form/create-commission-rule-details.tsx
|
|
138
148
|
import { Heading as Heading2, Input } from "@medusajs/ui";
|
|
139
149
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
140
|
-
import { usePermissionGate } from "@mercurjs/dashboard-shared";
|
|
150
|
+
import { FormExtensionZone as FormExtensionZone2, usePermissionGate } from "@mercurjs/dashboard-shared";
|
|
141
151
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
142
152
|
var CreateCommissionRuleDetails = () => {
|
|
143
153
|
const { t } = useTranslation2();
|
|
@@ -337,7 +347,16 @@ var CreateCommissionRuleDetails = () => {
|
|
|
337
347
|
] })
|
|
338
348
|
}
|
|
339
349
|
)
|
|
340
|
-
] })
|
|
350
|
+
] }),
|
|
351
|
+
/* @__PURE__ */ jsx2(
|
|
352
|
+
FormExtensionZone2,
|
|
353
|
+
{
|
|
354
|
+
model: "commission_rate",
|
|
355
|
+
zone: "create",
|
|
356
|
+
tab: "details",
|
|
357
|
+
control: form.control
|
|
358
|
+
}
|
|
359
|
+
)
|
|
341
360
|
] }) });
|
|
342
361
|
};
|
|
343
362
|
CreateCommissionRuleDetails._tabMeta = defineTabMeta(
|
|
@@ -414,11 +433,15 @@ var CreateCommissionRuleForm = () => {
|
|
|
414
433
|
const { t } = useTranslation3();
|
|
415
434
|
const { handleSuccess } = useRouteModal();
|
|
416
435
|
const { currencies } = useStoreCurrencies();
|
|
417
|
-
const
|
|
418
|
-
() =>
|
|
436
|
+
const schema = useMemo(
|
|
437
|
+
() => createCommissionRuleSchema(currencies),
|
|
419
438
|
[currencies]
|
|
420
439
|
);
|
|
421
|
-
const form =
|
|
440
|
+
const form = useExtendableForm({
|
|
441
|
+
// Refined schemas are merged by intersection inside useExtendableForm.
|
|
442
|
+
schema,
|
|
443
|
+
model: "commission_rate",
|
|
444
|
+
zone: "create",
|
|
422
445
|
defaultValues: {
|
|
423
446
|
title: "",
|
|
424
447
|
code: "",
|
|
@@ -431,8 +454,7 @@ var CreateCommissionRuleForm = () => {
|
|
|
431
454
|
fixed_values: {},
|
|
432
455
|
include_tax: false,
|
|
433
456
|
include_shipping: false
|
|
434
|
-
}
|
|
435
|
-
resolver
|
|
457
|
+
}
|
|
436
458
|
});
|
|
437
459
|
const { mutateAsync, isPending } = useCreateCommissionRule();
|
|
438
460
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
@@ -452,7 +474,8 @@ var CreateCommissionRuleForm = () => {
|
|
|
452
474
|
include_tax: values.include_tax,
|
|
453
475
|
include_shipping: values.include_shipping,
|
|
454
476
|
is_enabled: true,
|
|
455
|
-
...rules.length > 0 ? { rules } : {}
|
|
477
|
+
...rules.length > 0 ? { rules } : {},
|
|
478
|
+
additional_data: values.additional_data
|
|
456
479
|
},
|
|
457
480
|
{
|
|
458
481
|
onSuccess: ({ commission_rate }) => {
|