@mercurjs/admin 2.2.0-canary.15 → 2.2.0-canary.16
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/{add-campaign-promotions-KOGSYV2W.js → add-campaign-promotions-RUUZFQVO.js} +3 -3
- package/dist/{adjust-inventory-3IQ657W2.js → adjust-inventory-INVLBRJB.js} +11 -11
- package/dist/{api-key-management-create-UD5V7TOU.js → api-key-management-create-JWXWNGWI.js} +3 -3
- package/dist/{api-key-management-detail-V22TYNOF.js → api-key-management-detail-ZRLG6YRB.js} +17 -16
- package/dist/{api-key-management-edit-4TLKJSAE.js → api-key-management-edit-C2LDCO4Q.js} +3 -3
- package/dist/{api-key-management-list-SZUSD6UI.js → api-key-management-list-FVOOICQR.js} +4 -4
- package/dist/{api-key-management-sales-channels-SKKS5BCC.js → api-key-management-sales-channels-E245THAC.js} +6 -5
- package/dist/{attribute-create-IKTP5XRS.js → attribute-create-UAFKYP5S.js} +12 -12
- package/dist/{attribute-detail-V4QI34FV.js → attribute-detail-AKA6OHN5.js} +11 -11
- package/dist/{attribute-list-EMPHZ32M.js → attribute-list-DRVOY6FY.js} +11 -11
- package/dist/breadcrumb-CO5DVI72.js +26 -0
- package/dist/breadcrumb-RYIHOYZE.js +27 -0
- package/dist/{campaign-detail-QY3AALUR.js → campaign-detail-A7ZM4Q7M.js} +15 -15
- package/dist/{categories-metadata-Z5JAWPAK.js → categories-metadata-CBWDAGCZ.js} +11 -11
- package/dist/{category-create-GMCJABRW.js → category-create-Q6IPW7UC.js} +3 -3
- package/dist/{category-detail-IP5EPIUR.js → category-detail-CIEHVR4M.js} +14 -14
- package/dist/{category-edit-GLE4NTFG.js → category-edit-TBMN4JAH.js} +2 -2
- package/dist/{category-list-SNVOQ64L.js → category-list-4YSI36HW.js} +4 -4
- package/dist/{category-organize-UY4M4N7S.js → category-organize-U6UO35Y3.js} +2 -2
- package/dist/{category-products-HWXJR7KR.js → category-products-U7CRTTJQ.js} +12 -12
- package/dist/{chunk-5UPOHLBD.js → chunk-22V5D3VA.js} +1 -1
- package/dist/{chunk-ABWW3JHS.js → chunk-3DMUKRIX.js} +4 -4
- package/dist/{chunk-M572YFDA.js → chunk-3EUF5GRT.js} +2 -2
- package/dist/{chunk-SUVFPJ4J.js → chunk-3KCXKGHX.js} +2 -2
- package/dist/{chunk-KWFKMS4M.js → chunk-3XSMZOVD.js} +4 -4
- package/dist/{chunk-O2XHQTBX.js → chunk-47W2JHOE.js} +3 -3
- package/dist/chunk-4FHHNYIV.js +280 -0
- package/dist/{chunk-NGDOLGBQ.js → chunk-4Q5JHL4V.js} +1 -1
- package/dist/{chunk-3HY4I76Q.js → chunk-5BF5JDWT.js} +2 -2
- package/dist/{chunk-ZXBCWDVM.js → chunk-5T45PYWI.js} +3 -3
- package/dist/{chunk-5FFZQPTT.js → chunk-6PTZK4CH.js} +1 -1
- package/dist/{chunk-HDOWEXDH.js → chunk-A2GVK4VZ.js} +2 -2
- package/dist/{chunk-ZO7A6VYP.js → chunk-AIG4MQL4.js} +3 -3
- package/dist/chunk-AWLDIHXR.js +204 -0
- package/dist/{chunk-D2VXOF46.js → chunk-B4K7H6DH.js} +2 -2
- package/dist/{chunk-EMQP2CNF.js → chunk-D77BYNTQ.js} +1 -1
- package/dist/{chunk-54RTJBYO.js → chunk-DGCPYCHU.js} +8 -63
- package/dist/{chunk-QLEGHL2Q.js → chunk-EB6ZFOTO.js} +2 -2
- package/dist/{chunk-W3FDZPPF.js → chunk-EOLSQKPV.js} +2 -2
- package/dist/{chunk-BPCU5QJE.js → chunk-FBD7WJPO.js} +1 -1
- package/dist/{chunk-NJP3DEE5.js → chunk-FJHAAROU.js} +1 -1
- package/dist/{chunk-N4GJRJF5.js → chunk-FJRNNDZS.js} +1 -1
- package/dist/{chunk-PASEZJC7.js → chunk-FYCIGKVG.js} +1 -1
- package/dist/{chunk-LGL4QSGB.js → chunk-GC5VN6RD.js} +1 -1
- package/dist/{chunk-4GFS57XI.js → chunk-HLJ24XVH.js} +1 -1
- package/dist/{chunk-72PLRAWM.js → chunk-IBX52HBP.js} +1 -1
- package/dist/{chunk-2OF7GB7J.js → chunk-IC3ZLUKY.js} +1 -1
- package/dist/{chunk-KK67WP4G.js → chunk-IEPH6A2W.js} +71 -247
- package/dist/{chunk-3XSC3NEG.js → chunk-J3AMUGGZ.js} +1 -1
- package/dist/{chunk-HQWN3A5L.js → chunk-JRLDKKCM.js} +2 -2
- package/dist/{chunk-R7ESTJHN.js → chunk-K2C42QAV.js} +2 -2
- package/dist/{chunk-DN2K5EAH.js → chunk-KYFWVLWO.js} +1 -1
- package/dist/{chunk-CKNQJPAG.js → chunk-LEHS6RED.js} +4 -2
- package/dist/{chunk-CYGCCNIC.js → chunk-LKW2KWJ4.js} +2 -2
- package/dist/{chunk-H3MAUKL7.js → chunk-M2E3PKA4.js} +183 -183
- package/dist/{chunk-SJGIQGEC.js → chunk-MHVZVF6O.js} +1 -1
- package/dist/{chunk-K4WU4PVL.js → chunk-NZOB3LPA.js} +1 -1
- package/dist/{chunk-QUPUWR42.js → chunk-OAQJNQYL.js} +1 -1
- package/dist/{chunk-6FHQCLHQ.js → chunk-OKWGPKVK.js} +1 -1
- package/dist/{chunk-3AO6X4CE.js → chunk-PE6JFXWU.js} +1 -1
- package/dist/{chunk-A62MTLPR.js → chunk-Q5WTOVZZ.js} +12 -2
- package/dist/{chunk-Z5T5EPLF.js → chunk-QKJGSZI2.js} +1 -1
- package/dist/{chunk-DJWOIRLV.js → chunk-RUSMGNQ6.js} +1 -1
- package/dist/{chunk-MVDPDVMI.js → chunk-RWRL4AXD.js} +4 -4
- package/dist/{chunk-JSH7JEKY.js → chunk-RZ5SFALB.js} +2 -2
- package/dist/chunk-S6A4FVM2.js +170 -0
- package/dist/{chunk-7KZ5X5SU.js → chunk-SEQJOCTT.js} +3 -3
- package/dist/{chunk-W6V2L2FX.js → chunk-SNCZQATG.js} +2 -2
- package/dist/{chunk-EBYWGIOR.js → chunk-T4GL73RP.js} +1 -1
- package/dist/{chunk-N7OVIX55.js → chunk-TH6W26RC.js} +1 -1
- package/dist/{chunk-4PU6GDCE.js → chunk-TWCYZF6X.js} +1 -1
- package/dist/chunk-UKLRBS4W.js +61 -0
- package/dist/{chunk-WTK4MLMF.js → chunk-UVYWKQJF.js} +1 -1
- package/dist/{chunk-PXKDYD3M.js → chunk-VZ7GNMGX.js} +1 -1
- package/dist/{chunk-VY7PT4SI.js → chunk-W6J4SJ3Y.js} +1 -1
- package/dist/{chunk-TE4IF3MM.js → chunk-WJGABDWC.js} +1 -1
- package/dist/{chunk-VT5E7OMM.js → chunk-WUGV75DM.js} +1 -1
- package/dist/{chunk-P5XVG4PY.js → chunk-XGUUM3S6.js} +1 -1
- package/dist/{chunk-7MMLCMV3.js → chunk-XVSJKCCQ.js} +1 -1
- package/dist/{chunk-BQ6ZDY6L.js → chunk-YM523XTD.js} +3 -3
- package/dist/{chunk-453BC56K.js → chunk-Z2UBJXTU.js} +1 -1
- package/dist/{chunk-EGTH3PUK.js → chunk-ZB4TESPP.js} +2 -2
- package/dist/{collection-add-products-ABWXUOFD.js → collection-add-products-G6BQPBXA.js} +12 -12
- package/dist/{collection-create-BRMP6SIZ.js → collection-create-O3RG3BFE.js} +2 -2
- package/dist/{collection-detail-AMGR2B5N.js → collection-detail-TR7TDQZG.js} +13 -13
- package/dist/{collection-edit-YLWUEU4C.js → collection-edit-EKPMNFCK.js} +2 -2
- package/dist/{collection-list-6HZE43AC.js → collection-list-FOWSOTS7.js} +14 -14
- package/dist/{collection-metadata-JS5QP3GD.js → collection-metadata-UEXKSJRF.js} +11 -11
- package/dist/{commission-rate-create-PSPSJZR5.js → commission-rate-create-UX3IFSPP.js} +14 -14
- package/dist/{commission-rate-detail-U72E4ZIO.js → commission-rate-detail-VGYTGWLH.js} +12 -12
- package/dist/{commission-rate-edit-7NJPABVA.js → commission-rate-edit-FTBBWE7F.js} +14 -14
- package/dist/{customer-detail-2RWBN6C4.js → customer-detail-5XGZ2K3H.js} +13 -13
- package/dist/{customer-group-detail-ED66F7JM.js → customer-group-detail-JX3BEYFG.js} +11 -11
- package/dist/{customer-group-list-6YUFKBHH.js → customer-group-list-F5TFLDVH.js} +11 -11
- package/dist/{customer-group-metadata-VQUOWR3P.js → customer-group-metadata-MVD7V6DA.js} +11 -11
- package/dist/{customer-metadata-47AVJXRI.js → customer-metadata-LW6GL25F.js} +11 -11
- package/dist/{customers-add-customer-group-HI7J7YKN.js → customers-add-customer-group-NGPLFWCL.js} +11 -11
- package/dist/{edit-inventory-item-MBPSBJL4.js → edit-inventory-item-6Q2TVHKC.js} +11 -11
- package/dist/{edit-inventory-item-attributes-RVYWOFAC.js → edit-inventory-item-attributes-SZZ65XJ5.js} +11 -11
- package/dist/{edit-reservation-7BLGYXCJ.js → edit-reservation-TUCZRTBN.js} +2 -2
- package/dist/{edit-rules-ZWDKM5M3.js → edit-rules-WJEEV2XB.js} +11 -11
- package/dist/index.js +211 -179
- package/dist/{inventory-create-Q4VBPXSG.js → inventory-create-ZJDSLZ5R.js} +12 -12
- package/dist/{inventory-detail-6CKO3A3Y.js → inventory-detail-LSAJ3ZB5.js} +12 -12
- package/dist/{inventory-list-2JGX6BRI.js → inventory-list-SCRYOBZV.js} +2 -2
- package/dist/{inventory-metadata-COGGE5ZR.js → inventory-metadata-HDLZ6SNH.js} +11 -11
- package/dist/{inventory-stock-2QIKS7LE.js → inventory-stock-EHZJMHOY.js} +11 -11
- package/dist/loader-S77URTQS.js +32 -0
- package/dist/loader-XPJWDZU3.js +32 -0
- package/dist/{location-detail-HOCNTQ7K.js → location-detail-PBCP7BBV.js} +12 -12
- package/dist/{location-fulfillment-providers-YQ2XFPAJ.js → location-fulfillment-providers-NVVLRKJT.js} +13 -13
- package/dist/{location-list-KQQRH4MT.js → location-list-DM4WU57J.js} +11 -11
- package/dist/{location-sales-channels-DRIS6AUX.js → location-sales-channels-T7ZUQ3PA.js} +5 -4
- package/dist/{location-service-zone-shipping-option-create-6GYLJHEC.js → location-service-zone-shipping-option-create-VVD2GMM3.js} +11 -11
- package/dist/{login-N7CVSQNG.js → login-LTASZXSR.js} +11 -11
- package/dist/{manage-locations-TKLOHP3D.js → manage-locations-WW35SVOX.js} +1 -1
- package/dist/{marketplace-detail-K52ALYGT.js → marketplace-detail-GSPPUVR7.js} +12 -12
- package/dist/{marketplace-metadata-ZSX3IQF4.js → marketplace-metadata-35DDUX2Z.js} +11 -11
- package/dist/offer-detail-page-2DG3W7VG.js +572 -0
- package/dist/offer-variant-detail-page-U4LDYFE3.js +143 -0
- package/dist/{offers-UBD6NICA.js → offers-D2QQQD2F.js} +284 -123
- package/dist/{order-create-edit-HEOYCYZO.js → order-create-edit-QBVSHRFO.js} +3 -3
- package/dist/{order-create-exchange-L56VKQBL.js → order-create-exchange-67R63776.js} +11 -11
- package/dist/{order-create-refund-UTJKJ3AJ.js → order-create-refund-4CDCQGXT.js} +11 -11
- package/dist/{order-detail-KAB4MV7X.js → order-detail-A2WC2OZU.js} +13 -13
- package/dist/{order-edit-billing-address-RUURVISC.js → order-edit-billing-address-WFUOLHWY.js} +12 -12
- package/dist/{order-edit-email-OO7AMRHC.js → order-edit-email-CPIRJACP.js} +11 -11
- package/dist/{order-edit-shipping-address-BRRXUE76.js → order-edit-shipping-address-FCEL2URJ.js} +11 -11
- package/dist/{order-list-S3AJC6L5.js → order-list-QR3ZVI4U.js} +3 -3
- package/dist/{order-metadata-OHK6TPAO.js → order-metadata-NFTVCHFD.js} +11 -11
- package/dist/{order-request-transfer-YLMXC7NL.js → order-request-transfer-I6VIJK4L.js} +11 -11
- package/dist/pages/index.d.ts +2 -1
- package/dist/pages/index.js +90 -88
- package/dist/{price-list-configuration-Q5H22ZE2.js → price-list-configuration-I45NPXOI.js} +2 -2
- package/dist/{price-list-create-OYAVGRM5.js → price-list-create-QAEE6CAK.js} +13 -13
- package/dist/{price-list-detail-Q4GFFUFG.js → price-list-detail-77FAEXXO.js} +14 -14
- package/dist/{price-list-edit-YY4SXEI3.js → price-list-edit-A3SLXCYW.js} +2 -2
- package/dist/{price-list-list-OIOY43TF.js → price-list-list-AX7ZW6LL.js} +4 -4
- package/dist/{price-list-prices-add-KONZVSVQ.js → price-list-prices-add-TCW6S4Z3.js} +13 -13
- package/dist/{price-list-prices-edit-SMUKU7Q6.js → price-list-prices-edit-IGHGQ7DO.js} +11 -11
- package/dist/{product-add-existing-attributes-KOPVWK5Q.js → product-add-existing-attributes-BWEKWIWW.js} +11 -11
- package/dist/{product-attributes-C3KHQF2I.js → product-attributes-3VQAHGYZ.js} +1 -1
- package/dist/{product-bulk-edit-J3CMBZN2.js → product-bulk-edit-PLNZZO3C.js} +1 -1
- package/dist/{product-create-KTIQ3UAQ.js → product-create-AGSEC63C.js} +15 -15
- package/dist/{product-create-attribute-XARMC6FJ.js → product-create-attribute-PFIEDJNX.js} +1 -1
- package/dist/{product-create-variant-6VUKYLWE.js → product-create-variant-PP6PQF4T.js} +2 -2
- package/dist/{product-detail-UB3EZRDE.js → product-detail-CNVETME5.js} +15 -13
- package/dist/{product-edit-F4CKOIUO.js → product-edit-LBKIDCQM.js} +1 -1
- package/dist/{product-edit-attribute-LG2ZM6HQ.js → product-edit-attribute-RVNIUPIO.js} +1 -1
- package/dist/{product-list-2BWYAATR.js → product-list-KM37QJ6F.js} +13 -13
- package/dist/{product-media-EUDMCJ75.js → product-media-UWEOWTJT.js} +3 -3
- package/dist/{product-metadata-5WVNFCRL.js → product-metadata-6E6AZTHQ.js} +11 -11
- package/dist/{product-organization-BFWDCHP4.js → product-organization-2ZNTDHWP.js} +3 -3
- package/dist/{product-sales-channels-2J5Q65JS.js → product-sales-channels-7QCAABL4.js} +5 -4
- package/dist/{product-shipping-profile-WDLKA2SN.js → product-shipping-profile-UOQWHIO2.js} +1 -1
- package/dist/{product-tag-create-KQSVCWMC.js → product-tag-create-RDJNNVKB.js} +11 -11
- package/dist/{product-tag-detail-CWDAY7F3.js → product-tag-detail-R6UFJDCW.js} +14 -14
- package/dist/{product-tag-edit-B4SIZCUK.js → product-tag-edit-NQPOV5FR.js} +11 -11
- package/dist/{product-tag-list-2OK3OCMZ.js → product-tag-list-NFPQVVMO.js} +13 -13
- package/dist/{product-tag-metadata-MASTMIKE.js → product-tag-metadata-MYCCUFNT.js} +11 -11
- package/dist/{product-type-detail-3X7ZTZJN.js → product-type-detail-XJPSQDL2.js} +13 -13
- package/dist/{product-type-metadata-6BKTQHQC.js → product-type-metadata-IMMCIWOD.js} +11 -11
- package/dist/{product-variant-detail-PQ4RKPZT.js → product-variant-detail-VCMC4BZP.js} +12 -12
- package/dist/{product-variant-edit-TLF475SH.js → product-variant-edit-OXNWRFST.js} +11 -11
- package/dist/{product-variant-metadata-3M72B3PM.js → product-variant-metadata-ZIJG2HNS.js} +11 -11
- package/dist/{promotion-create-OKZBUSJD.js → promotion-create-CBOD7FVH.js} +11 -11
- package/dist/{promotion-detail-MMNEDRXD.js → promotion-detail-NSOGXQAY.js} +14 -14
- package/dist/{promotion-list-DHWW7FTI.js → promotion-list-7C3SQCSO.js} +4 -4
- package/dist/{refund-reason-create-N4DZ4UHS.js → refund-reason-create-V52L4U5V.js} +11 -11
- package/dist/{refund-reason-edit-OAHRDKXW.js → refund-reason-edit-3U6REVYW.js} +11 -11
- package/dist/{refund-reason-list-3BTQCIYE.js → refund-reason-list-SWU4B2ED.js} +11 -11
- package/dist/{region-metadata-BJSTTZFL.js → region-metadata-5YVOM47I.js} +11 -11
- package/dist/{reservation-create-TXYAY3KF.js → reservation-create-TNZQP7XW.js} +2 -2
- package/dist/{reservation-detail-CEENG76D.js → reservation-detail-BLPISKPA.js} +12 -12
- package/dist/{reservation-list-SORWYHI4.js → reservation-list-3OKWSHWH.js} +3 -3
- package/dist/{reservation-metadata-G3QBZF4K.js → reservation-metadata-VXWNURF4.js} +11 -11
- package/dist/{reset-password-QGQ4GAHK.js → reset-password-6CAYNSJ6.js} +1 -1
- package/dist/{sales-channel-add-products-3VZ5SLLP.js → sales-channel-add-products-LUKSBD5K.js} +12 -12
- package/dist/{sales-channel-create-XBR3QESI.js → sales-channel-create-O5KGQ6DU.js} +2 -2
- package/dist/{sales-channel-detail-PHRSKCNM.js → sales-channel-detail-6JPHP4FZ.js} +13 -13
- package/dist/{sales-channel-edit-ILBZBQP4.js → sales-channel-edit-CG3YUSYW.js} +2 -2
- package/dist/{sales-channel-list-E647FXSZ.js → sales-channel-list-D673ONK2.js} +15 -14
- package/dist/{sales-channel-metadata-HVPGS756.js → sales-channel-metadata-CHYCJOLY.js} +11 -11
- package/dist/{shipping-option-type-create-3ZKT7WAC.js → shipping-option-type-create-P2BCCARC.js} +11 -11
- package/dist/{shipping-option-type-detail-IYXWAK7F.js → shipping-option-type-detail-NVSXILP4.js} +11 -11
- package/dist/{shipping-option-type-edit-QRXYNNRW.js → shipping-option-type-edit-Z4ZLUANO.js} +11 -11
- package/dist/{shipping-option-type-list-MLIDCA3L.js → shipping-option-type-list-OUKJZJ6R.js} +11 -11
- package/dist/{shipping-profile-metadata-T4HPNTLH.js → shipping-profile-metadata-HS7TYNEX.js} +13 -13
- package/dist/{store-create-KFLNOD73.js → store-create-PHLTX6J3.js} +11 -11
- package/dist/{store-details-E347PHAN.js → store-details-V3NMV665.js} +14 -14
- package/dist/{store-edit-Y6NLBIOP.js → store-edit-CUVQLEFL.js} +2 -2
- package/dist/{store-list-S2L44OLB.js → store-list-WV6XHGLU.js} +13 -13
- package/dist/{tax-region-create-MIDQXQS4.js → tax-region-create-7UCI2QDJ.js} +12 -12
- package/dist/{tax-region-detail-AC7B3G57.js → tax-region-detail-OKEK6WNJ.js} +13 -13
- package/dist/{tax-region-edit-5CORTHTC.js → tax-region-edit-7O33SWZQ.js} +11 -11
- package/dist/{tax-region-metadata-QQZIQPAD.js → tax-region-metadata-6LMVFCFW.js} +11 -11
- package/dist/{tax-region-province-detail-2MGX7LEO.js → tax-region-province-detail-WHO3RLUX.js} +13 -13
- package/dist/{tax-region-tax-override-create-IONGD4TG.js → tax-region-tax-override-create-3FBV7DND.js} +14 -14
- package/dist/{tax-region-tax-override-edit-RIT6YRVK.js → tax-region-tax-override-edit-RZPP66BY.js} +14 -14
- package/dist/{user-detail-MMVBN3AE.js → user-detail-6CCQQPFR.js} +1 -1
- package/dist/{user-metadata-OZLU3Y2X.js → user-metadata-OYX24QL7.js} +11 -11
- package/package.json +1 -1
- package/dist/[id]-BAPEFPAO.js +0 -505
- package/dist/chunk-PT5PLV3N.js +0 -78
- package/dist/loader-OU7SKXOD.js +0 -28
|
@@ -8,17 +8,176 @@ import {
|
|
|
8
8
|
sdk
|
|
9
9
|
} from "./chunk-ZBWL72TB.js";
|
|
10
10
|
|
|
11
|
-
// src/hooks/api/
|
|
11
|
+
// src/hooks/api/products.tsx
|
|
12
12
|
import {
|
|
13
13
|
useMutation as useMutation2,
|
|
14
14
|
useQuery as useQuery2
|
|
15
15
|
} from "@tanstack/react-query";
|
|
16
16
|
|
|
17
|
-
// src/hooks/api/
|
|
17
|
+
// src/hooks/api/inventory.tsx
|
|
18
18
|
import {
|
|
19
19
|
useMutation,
|
|
20
20
|
useQuery
|
|
21
21
|
} from "@tanstack/react-query";
|
|
22
|
+
var INVENTORY_ITEMS_QUERY_KEY = "inventory_items";
|
|
23
|
+
var inventoryItemsQueryKeys = queryKeysFactory(
|
|
24
|
+
INVENTORY_ITEMS_QUERY_KEY
|
|
25
|
+
);
|
|
26
|
+
var INVENTORY_ITEM_LEVELS_QUERY_KEY = "inventory_item_levels";
|
|
27
|
+
var inventoryItemLevelsQueryKeys = queryKeysFactory(
|
|
28
|
+
INVENTORY_ITEM_LEVELS_QUERY_KEY
|
|
29
|
+
);
|
|
30
|
+
var useInventoryItems = (query, options) => {
|
|
31
|
+
const { data, ...rest } = useQuery({
|
|
32
|
+
queryFn: () => sdk.admin.inventoryItems.query({ ...query }),
|
|
33
|
+
queryKey: inventoryItemsQueryKeys.list(query),
|
|
34
|
+
...options
|
|
35
|
+
});
|
|
36
|
+
return { ...data, ...rest };
|
|
37
|
+
};
|
|
38
|
+
var useInventoryItem = (id, query, options) => {
|
|
39
|
+
const { data, ...rest } = useQuery({
|
|
40
|
+
queryFn: () => sdk.admin.inventoryItems.$id.query({ $id: id, ...query }),
|
|
41
|
+
queryKey: inventoryItemsQueryKeys.detail(id),
|
|
42
|
+
...options
|
|
43
|
+
});
|
|
44
|
+
return { ...data, ...rest };
|
|
45
|
+
};
|
|
46
|
+
var useCreateInventoryItem = (options) => {
|
|
47
|
+
return useMutation({
|
|
48
|
+
mutationFn: (payload) => sdk.admin.inventoryItems.mutate(payload),
|
|
49
|
+
onSuccess: (data, variables, context) => {
|
|
50
|
+
queryClient.invalidateQueries({
|
|
51
|
+
queryKey: inventoryItemsQueryKeys.lists()
|
|
52
|
+
});
|
|
53
|
+
options?.onSuccess?.(data, variables, context);
|
|
54
|
+
},
|
|
55
|
+
...options
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var useUpdateInventoryItem = (id, options) => {
|
|
59
|
+
return useMutation({
|
|
60
|
+
mutationFn: (payload) => sdk.admin.inventoryItems.$id.mutate({ $id: id, ...payload }),
|
|
61
|
+
onSuccess: (data, variables, context) => {
|
|
62
|
+
queryClient.invalidateQueries({
|
|
63
|
+
queryKey: inventoryItemsQueryKeys.lists()
|
|
64
|
+
});
|
|
65
|
+
queryClient.invalidateQueries({
|
|
66
|
+
queryKey: inventoryItemsQueryKeys.detail(id)
|
|
67
|
+
});
|
|
68
|
+
options?.onSuccess?.(data, variables, context);
|
|
69
|
+
},
|
|
70
|
+
...options
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
var useDeleteInventoryItem = (id, options) => {
|
|
74
|
+
return useMutation({
|
|
75
|
+
mutationFn: () => sdk.admin.inventoryItems.$id.delete({ $id: id }),
|
|
76
|
+
onSuccess: (data, variables, context) => {
|
|
77
|
+
queryClient.invalidateQueries({
|
|
78
|
+
queryKey: inventoryItemsQueryKeys.lists()
|
|
79
|
+
});
|
|
80
|
+
queryClient.invalidateQueries({
|
|
81
|
+
queryKey: inventoryItemsQueryKeys.detail(id)
|
|
82
|
+
});
|
|
83
|
+
options?.onSuccess?.(data, variables, context);
|
|
84
|
+
},
|
|
85
|
+
...options
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
var useInventoryItemLevels = (inventoryItemId, query, options) => {
|
|
89
|
+
const { data, ...rest } = useQuery({
|
|
90
|
+
queryFn: () => sdk.admin.inventoryItems.$id.locationLevels.query({
|
|
91
|
+
$id: inventoryItemId,
|
|
92
|
+
...query
|
|
93
|
+
}),
|
|
94
|
+
queryKey: inventoryItemLevelsQueryKeys.list({
|
|
95
|
+
...query || {},
|
|
96
|
+
inventoryItemId
|
|
97
|
+
}),
|
|
98
|
+
...options
|
|
99
|
+
});
|
|
100
|
+
return { ...data, ...rest };
|
|
101
|
+
};
|
|
102
|
+
var useUpdateInventoryLevel = (inventoryItemId, locationId, options) => {
|
|
103
|
+
return useMutation({
|
|
104
|
+
mutationFn: (payload) => sdk.admin.inventoryItems.$id.locationLevels.$locationId.mutate({
|
|
105
|
+
$id: inventoryItemId,
|
|
106
|
+
$locationId: locationId,
|
|
107
|
+
...payload
|
|
108
|
+
}),
|
|
109
|
+
onSuccess: (data, variables, context) => {
|
|
110
|
+
queryClient.invalidateQueries({
|
|
111
|
+
queryKey: inventoryItemsQueryKeys.lists()
|
|
112
|
+
});
|
|
113
|
+
queryClient.invalidateQueries({
|
|
114
|
+
queryKey: inventoryItemsQueryKeys.detail(inventoryItemId)
|
|
115
|
+
});
|
|
116
|
+
queryClient.invalidateQueries({
|
|
117
|
+
queryKey: inventoryItemLevelsQueryKeys.detail(inventoryItemId)
|
|
118
|
+
});
|
|
119
|
+
queryClient.invalidateQueries({
|
|
120
|
+
queryKey: inventoryItemLevelsQueryKeys.list({ inventoryItemId })
|
|
121
|
+
});
|
|
122
|
+
queryClient.invalidateQueries({
|
|
123
|
+
queryKey: variantsQueryKeys.details()
|
|
124
|
+
});
|
|
125
|
+
options?.onSuccess?.(data, variables, context);
|
|
126
|
+
},
|
|
127
|
+
...options
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
var useBatchInventoryItemLocationLevels = (inventoryItemId, options) => {
|
|
131
|
+
return useMutation({
|
|
132
|
+
mutationFn: (payload) => {
|
|
133
|
+
return sdk.admin.inventoryItems.$id.locationLevels.batch.mutate({
|
|
134
|
+
$id: inventoryItemId,
|
|
135
|
+
...payload,
|
|
136
|
+
// force: true is required for admin batch endpoint to delete levels with stocked items
|
|
137
|
+
force: !!payload?.delete?.length || payload.force
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
onSuccess: (data, variables, context) => {
|
|
141
|
+
queryClient.invalidateQueries({
|
|
142
|
+
queryKey: inventoryItemsQueryKeys.lists()
|
|
143
|
+
});
|
|
144
|
+
queryClient.invalidateQueries({
|
|
145
|
+
queryKey: inventoryItemsQueryKeys.detail(inventoryItemId)
|
|
146
|
+
});
|
|
147
|
+
queryClient.invalidateQueries({
|
|
148
|
+
queryKey: inventoryItemLevelsQueryKeys.detail(inventoryItemId)
|
|
149
|
+
});
|
|
150
|
+
queryClient.invalidateQueries({
|
|
151
|
+
queryKey: inventoryItemLevelsQueryKeys.list({ inventoryItemId })
|
|
152
|
+
});
|
|
153
|
+
options?.onSuccess?.(data, variables, context);
|
|
154
|
+
},
|
|
155
|
+
...options
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
var useBatchInventoryItemsLocationLevels = (options) => {
|
|
159
|
+
return useMutation({
|
|
160
|
+
mutationFn: (payload) => {
|
|
161
|
+
return sdk.admin.inventoryItems.locationLevels.batch.mutate({
|
|
162
|
+
...payload,
|
|
163
|
+
// force: true is required for admin batch endpoint to delete levels with stocked items
|
|
164
|
+
force: !!payload?.delete?.length || payload.force
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
onSuccess: (data, variables, context) => {
|
|
168
|
+
queryClient.invalidateQueries({
|
|
169
|
+
queryKey: inventoryItemsQueryKeys.all
|
|
170
|
+
});
|
|
171
|
+
queryClient.invalidateQueries({
|
|
172
|
+
queryKey: variantsQueryKeys.lists()
|
|
173
|
+
});
|
|
174
|
+
options?.onSuccess?.(data, variables, context);
|
|
175
|
+
},
|
|
176
|
+
...options
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// src/hooks/api/products.tsx
|
|
22
181
|
var PRODUCTS_QUERY_KEY = "products";
|
|
23
182
|
var productsQueryKeys = queryKeysFactory(PRODUCTS_QUERY_KEY);
|
|
24
183
|
var VARIANTS_QUERY_KEY = "product_variants";
|
|
@@ -28,7 +187,7 @@ var productChangeQueryKeys = queryKeysFactory(
|
|
|
28
187
|
PRODUCT_CHANGE_QUERY_KEY
|
|
29
188
|
);
|
|
30
189
|
var useProduct = (id, query, options) => {
|
|
31
|
-
const { data, ...rest } =
|
|
190
|
+
const { data, ...rest } = useQuery2({
|
|
32
191
|
queryFn: () => sdk.admin.products.$id.query({ $id: id, ...query }),
|
|
33
192
|
queryKey: productsQueryKeys.detail(id, query),
|
|
34
193
|
...options
|
|
@@ -36,7 +195,7 @@ var useProduct = (id, query, options) => {
|
|
|
36
195
|
return { ...data, ...rest };
|
|
37
196
|
};
|
|
38
197
|
var useProducts = (query, options) => {
|
|
39
|
-
const { data, ...rest } =
|
|
198
|
+
const { data, ...rest } = useQuery2({
|
|
40
199
|
queryFn: () => sdk.admin.products.query({ ...query }),
|
|
41
200
|
queryKey: productsQueryKeys.list(query),
|
|
42
201
|
...options
|
|
@@ -44,7 +203,7 @@ var useProducts = (query, options) => {
|
|
|
44
203
|
return { ...data, ...rest };
|
|
45
204
|
};
|
|
46
205
|
var useCreateProduct = (options) => {
|
|
47
|
-
return
|
|
206
|
+
return useMutation2({
|
|
48
207
|
mutationFn: (payload) => sdk.admin.products.mutate(payload),
|
|
49
208
|
onSuccess: (data, variables, context) => {
|
|
50
209
|
queryClient.invalidateQueries({ queryKey: productsQueryKeys.lists() });
|
|
@@ -57,7 +216,7 @@ var useCreateProduct = (options) => {
|
|
|
57
216
|
});
|
|
58
217
|
};
|
|
59
218
|
var useUpdateProduct = (id, options) => {
|
|
60
|
-
return
|
|
219
|
+
return useMutation2({
|
|
61
220
|
mutationFn: (payload) => sdk.admin.products.$id.mutate({ $id: id, ...payload }),
|
|
62
221
|
onSuccess: async (data, variables, context) => {
|
|
63
222
|
await queryClient.invalidateQueries({
|
|
@@ -72,7 +231,7 @@ var useUpdateProduct = (id, options) => {
|
|
|
72
231
|
});
|
|
73
232
|
};
|
|
74
233
|
var useDeleteProduct = (id, options) => {
|
|
75
|
-
return
|
|
234
|
+
return useMutation2({
|
|
76
235
|
mutationFn: () => sdk.admin.products.$id.delete({ $id: id }),
|
|
77
236
|
onSuccess: (data, variables, context) => {
|
|
78
237
|
queryClient.invalidateQueries({ queryKey: productsQueryKeys.lists() });
|
|
@@ -83,7 +242,7 @@ var useDeleteProduct = (id, options) => {
|
|
|
83
242
|
});
|
|
84
243
|
};
|
|
85
244
|
var useBatchProducts = (options) => {
|
|
86
|
-
return
|
|
245
|
+
return useMutation2({
|
|
87
246
|
mutationFn: (payload) => sdk.admin.products.batch.mutate(payload),
|
|
88
247
|
onSuccess: (data, variables, context) => {
|
|
89
248
|
queryClient.invalidateQueries({ queryKey: productsQueryKeys.all });
|
|
@@ -93,7 +252,7 @@ var useBatchProducts = (options) => {
|
|
|
93
252
|
});
|
|
94
253
|
};
|
|
95
254
|
var useConfirmProduct = (id, options) => {
|
|
96
|
-
return
|
|
255
|
+
return useMutation2({
|
|
97
256
|
mutationFn: (payload) => sdk.admin.products.$id.confirm.mutate({
|
|
98
257
|
$id: id,
|
|
99
258
|
...payload ?? {}
|
|
@@ -107,7 +266,7 @@ var useConfirmProduct = (id, options) => {
|
|
|
107
266
|
});
|
|
108
267
|
};
|
|
109
268
|
var useRejectProduct = (id, options) => {
|
|
110
|
-
return
|
|
269
|
+
return useMutation2({
|
|
111
270
|
mutationFn: (payload) => sdk.admin.products.$id.reject.mutate({ $id: id, ...payload }),
|
|
112
271
|
onSuccess: (data, variables, context) => {
|
|
113
272
|
queryClient.invalidateQueries({ queryKey: productsQueryKeys.lists() });
|
|
@@ -118,7 +277,7 @@ var useRejectProduct = (id, options) => {
|
|
|
118
277
|
});
|
|
119
278
|
};
|
|
120
279
|
var useRequestProductChanges = (id, options) => {
|
|
121
|
-
return
|
|
280
|
+
return useMutation2({
|
|
122
281
|
mutationFn: (payload) => sdk.admin.products.$id.requestChanges.mutate({ $id: id, ...payload }),
|
|
123
282
|
onSuccess: (data, variables, context) => {
|
|
124
283
|
queryClient.invalidateQueries({ queryKey: productsQueryKeys.lists() });
|
|
@@ -129,7 +288,7 @@ var useRequestProductChanges = (id, options) => {
|
|
|
129
288
|
});
|
|
130
289
|
};
|
|
131
290
|
var useProductChange = (productId, options) => {
|
|
132
|
-
const { data, ...rest } =
|
|
291
|
+
const { data, ...rest } = useQuery2({
|
|
133
292
|
queryFn: () => sdk.admin.products.$id.preview.query({ $id: productId }),
|
|
134
293
|
queryKey: productChangeQueryKeys.detail(productId),
|
|
135
294
|
...options
|
|
@@ -137,7 +296,7 @@ var useProductChange = (productId, options) => {
|
|
|
137
296
|
return { ...data, ...rest };
|
|
138
297
|
};
|
|
139
298
|
var useConfirmProductChange = (productChangeId, productId, options) => {
|
|
140
|
-
return
|
|
299
|
+
return useMutation2({
|
|
141
300
|
mutationFn: (payload) => sdk.admin.productChanges.$id.confirm.mutate({
|
|
142
301
|
$id: productChangeId,
|
|
143
302
|
...payload ?? {}
|
|
@@ -156,7 +315,7 @@ var useConfirmProductChange = (productChangeId, productId, options) => {
|
|
|
156
315
|
});
|
|
157
316
|
};
|
|
158
317
|
var useCancelProductChange = (productChangeId, productId, options) => {
|
|
159
|
-
return
|
|
318
|
+
return useMutation2({
|
|
160
319
|
mutationFn: (payload) => sdk.admin.productChanges.$id.cancel.mutate({
|
|
161
320
|
$id: productChangeId,
|
|
162
321
|
...payload ?? {}
|
|
@@ -175,7 +334,7 @@ var useCancelProductChange = (productChangeId, productId, options) => {
|
|
|
175
334
|
});
|
|
176
335
|
};
|
|
177
336
|
var useProductVariant = (productId, variantId, query, options) => {
|
|
178
|
-
const { data, ...rest } =
|
|
337
|
+
const { data, ...rest } = useQuery2({
|
|
179
338
|
queryFn: () => sdk.admin.products.$id.variants.$variantId.query({
|
|
180
339
|
$id: productId,
|
|
181
340
|
$variantId: variantId,
|
|
@@ -187,7 +346,7 @@ var useProductVariant = (productId, variantId, query, options) => {
|
|
|
187
346
|
return { ...data, ...rest };
|
|
188
347
|
};
|
|
189
348
|
var useProductVariants = (productId, query, options) => {
|
|
190
|
-
const { data, ...rest } =
|
|
349
|
+
const { data, ...rest } = useQuery2({
|
|
191
350
|
queryFn: () => sdk.admin.products.$id.variants.query({ $id: productId, ...query }),
|
|
192
351
|
queryKey: variantsQueryKeys.list({ productId, ...query }),
|
|
193
352
|
...options
|
|
@@ -195,7 +354,7 @@ var useProductVariants = (productId, query, options) => {
|
|
|
195
354
|
return { ...data, ...rest };
|
|
196
355
|
};
|
|
197
356
|
var useCreateProductVariant = (productId, options) => {
|
|
198
|
-
return
|
|
357
|
+
return useMutation2({
|
|
199
358
|
mutationFn: (payload) => sdk.admin.products.$id.variants.mutate({ $id: productId, ...payload }),
|
|
200
359
|
onSuccess: (data, variables, context) => {
|
|
201
360
|
queryClient.invalidateQueries({ queryKey: variantsQueryKeys.lists() });
|
|
@@ -208,7 +367,7 @@ var useCreateProductVariant = (productId, options) => {
|
|
|
208
367
|
});
|
|
209
368
|
};
|
|
210
369
|
var useUpdateProductVariant = (productId, variantId, options) => {
|
|
211
|
-
return
|
|
370
|
+
return useMutation2({
|
|
212
371
|
mutationFn: (payload) => sdk.admin.products.$id.variants.$variantId.mutate({
|
|
213
372
|
$id: productId,
|
|
214
373
|
$variantId: variantId,
|
|
@@ -228,7 +387,7 @@ var useUpdateProductVariant = (productId, variantId, options) => {
|
|
|
228
387
|
});
|
|
229
388
|
};
|
|
230
389
|
var useDeleteVariant = (productId, variantId, options) => {
|
|
231
|
-
return
|
|
390
|
+
return useMutation2({
|
|
232
391
|
mutationFn: () => sdk.admin.products.$id.variants.$variantId.delete({
|
|
233
392
|
$id: productId,
|
|
234
393
|
$variantId: variantId
|
|
@@ -247,7 +406,7 @@ var useDeleteVariant = (productId, variantId, options) => {
|
|
|
247
406
|
});
|
|
248
407
|
};
|
|
249
408
|
var useDeleteVariantLazy = (productId, options) => {
|
|
250
|
-
return
|
|
409
|
+
return useMutation2({
|
|
251
410
|
mutationFn: ({ variantId }) => sdk.admin.products.$id.variants.$variantId.delete({
|
|
252
411
|
$id: productId,
|
|
253
412
|
$variantId: variantId
|
|
@@ -270,7 +429,7 @@ var scopedProductAttributesQueryKeys = queryKeysFactory(
|
|
|
270
429
|
PRODUCT_ATTRIBUTES_QUERY_KEY
|
|
271
430
|
);
|
|
272
431
|
var useAddAttributeToProduct = (productId, options) => {
|
|
273
|
-
return
|
|
432
|
+
return useMutation2({
|
|
274
433
|
mutationFn: (payload) => sdk.admin.products.$id.attributes.mutate({ $id: productId, ...payload }),
|
|
275
434
|
onSuccess: (data, variables, context) => {
|
|
276
435
|
queryClient.invalidateQueries({
|
|
@@ -285,7 +444,7 @@ var useAddAttributeToProduct = (productId, options) => {
|
|
|
285
444
|
});
|
|
286
445
|
};
|
|
287
446
|
var useUpdateAttributeOnProduct = (productId, attributeId, options) => {
|
|
288
|
-
return
|
|
447
|
+
return useMutation2({
|
|
289
448
|
mutationFn: (payload) => sdk.admin.products.$id.attributes.$attributeId.mutate({
|
|
290
449
|
$id: productId,
|
|
291
450
|
$attributeId: attributeId,
|
|
@@ -304,7 +463,7 @@ var useUpdateAttributeOnProduct = (productId, attributeId, options) => {
|
|
|
304
463
|
});
|
|
305
464
|
};
|
|
306
465
|
var useRemoveAttributeFromProduct = (productId, attributeId, options) => {
|
|
307
|
-
return
|
|
466
|
+
return useMutation2({
|
|
308
467
|
mutationFn: () => sdk.admin.products.$id.attributes.$attributeId.delete({
|
|
309
468
|
$id: productId,
|
|
310
469
|
$attributeId: attributeId
|
|
@@ -322,7 +481,7 @@ var useRemoveAttributeFromProduct = (productId, attributeId, options) => {
|
|
|
322
481
|
});
|
|
323
482
|
};
|
|
324
483
|
var useBatchProductAttributes = (productId, options) => {
|
|
325
|
-
return
|
|
484
|
+
return useMutation2({
|
|
326
485
|
mutationFn: (payload) => sdk.admin.products.$id.attributes.batch.mutate({
|
|
327
486
|
$id: productId,
|
|
328
487
|
...payload
|
|
@@ -340,165 +499,6 @@ var useBatchProductAttributes = (productId, options) => {
|
|
|
340
499
|
});
|
|
341
500
|
};
|
|
342
501
|
|
|
343
|
-
// src/hooks/api/inventory.tsx
|
|
344
|
-
var INVENTORY_ITEMS_QUERY_KEY = "inventory_items";
|
|
345
|
-
var inventoryItemsQueryKeys = queryKeysFactory(
|
|
346
|
-
INVENTORY_ITEMS_QUERY_KEY
|
|
347
|
-
);
|
|
348
|
-
var INVENTORY_ITEM_LEVELS_QUERY_KEY = "inventory_item_levels";
|
|
349
|
-
var inventoryItemLevelsQueryKeys = queryKeysFactory(
|
|
350
|
-
INVENTORY_ITEM_LEVELS_QUERY_KEY
|
|
351
|
-
);
|
|
352
|
-
var useInventoryItems = (query, options) => {
|
|
353
|
-
const { data, ...rest } = useQuery2({
|
|
354
|
-
queryFn: () => sdk.admin.inventoryItems.query({ ...query }),
|
|
355
|
-
queryKey: inventoryItemsQueryKeys.list(query),
|
|
356
|
-
...options
|
|
357
|
-
});
|
|
358
|
-
return { ...data, ...rest };
|
|
359
|
-
};
|
|
360
|
-
var useInventoryItem = (id, query, options) => {
|
|
361
|
-
const { data, ...rest } = useQuery2({
|
|
362
|
-
queryFn: () => sdk.admin.inventoryItems.$id.query({ $id: id, ...query }),
|
|
363
|
-
queryKey: inventoryItemsQueryKeys.detail(id),
|
|
364
|
-
...options
|
|
365
|
-
});
|
|
366
|
-
return { ...data, ...rest };
|
|
367
|
-
};
|
|
368
|
-
var useCreateInventoryItem = (options) => {
|
|
369
|
-
return useMutation2({
|
|
370
|
-
mutationFn: (payload) => sdk.admin.inventoryItems.mutate(payload),
|
|
371
|
-
onSuccess: (data, variables, context) => {
|
|
372
|
-
queryClient.invalidateQueries({
|
|
373
|
-
queryKey: inventoryItemsQueryKeys.lists()
|
|
374
|
-
});
|
|
375
|
-
options?.onSuccess?.(data, variables, context);
|
|
376
|
-
},
|
|
377
|
-
...options
|
|
378
|
-
});
|
|
379
|
-
};
|
|
380
|
-
var useUpdateInventoryItem = (id, options) => {
|
|
381
|
-
return useMutation2({
|
|
382
|
-
mutationFn: (payload) => sdk.admin.inventoryItems.$id.mutate({ $id: id, ...payload }),
|
|
383
|
-
onSuccess: (data, variables, context) => {
|
|
384
|
-
queryClient.invalidateQueries({
|
|
385
|
-
queryKey: inventoryItemsQueryKeys.lists()
|
|
386
|
-
});
|
|
387
|
-
queryClient.invalidateQueries({
|
|
388
|
-
queryKey: inventoryItemsQueryKeys.detail(id)
|
|
389
|
-
});
|
|
390
|
-
options?.onSuccess?.(data, variables, context);
|
|
391
|
-
},
|
|
392
|
-
...options
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
|
-
var useDeleteInventoryItem = (id, options) => {
|
|
396
|
-
return useMutation2({
|
|
397
|
-
mutationFn: () => sdk.admin.inventoryItems.$id.delete({ $id: id }),
|
|
398
|
-
onSuccess: (data, variables, context) => {
|
|
399
|
-
queryClient.invalidateQueries({
|
|
400
|
-
queryKey: inventoryItemsQueryKeys.lists()
|
|
401
|
-
});
|
|
402
|
-
queryClient.invalidateQueries({
|
|
403
|
-
queryKey: inventoryItemsQueryKeys.detail(id)
|
|
404
|
-
});
|
|
405
|
-
options?.onSuccess?.(data, variables, context);
|
|
406
|
-
},
|
|
407
|
-
...options
|
|
408
|
-
});
|
|
409
|
-
};
|
|
410
|
-
var useInventoryItemLevels = (inventoryItemId, query, options) => {
|
|
411
|
-
const { data, ...rest } = useQuery2({
|
|
412
|
-
queryFn: () => sdk.admin.inventoryItems.$id.locationLevels.query({
|
|
413
|
-
$id: inventoryItemId,
|
|
414
|
-
...query
|
|
415
|
-
}),
|
|
416
|
-
queryKey: inventoryItemLevelsQueryKeys.list({
|
|
417
|
-
...query || {},
|
|
418
|
-
inventoryItemId
|
|
419
|
-
}),
|
|
420
|
-
...options
|
|
421
|
-
});
|
|
422
|
-
return { ...data, ...rest };
|
|
423
|
-
};
|
|
424
|
-
var useUpdateInventoryLevel = (inventoryItemId, locationId, options) => {
|
|
425
|
-
return useMutation2({
|
|
426
|
-
mutationFn: (payload) => sdk.admin.inventoryItems.$id.locationLevels.$locationId.mutate({
|
|
427
|
-
$id: inventoryItemId,
|
|
428
|
-
$locationId: locationId,
|
|
429
|
-
...payload
|
|
430
|
-
}),
|
|
431
|
-
onSuccess: (data, variables, context) => {
|
|
432
|
-
queryClient.invalidateQueries({
|
|
433
|
-
queryKey: inventoryItemsQueryKeys.lists()
|
|
434
|
-
});
|
|
435
|
-
queryClient.invalidateQueries({
|
|
436
|
-
queryKey: inventoryItemsQueryKeys.detail(inventoryItemId)
|
|
437
|
-
});
|
|
438
|
-
queryClient.invalidateQueries({
|
|
439
|
-
queryKey: inventoryItemLevelsQueryKeys.detail(inventoryItemId)
|
|
440
|
-
});
|
|
441
|
-
queryClient.invalidateQueries({
|
|
442
|
-
queryKey: inventoryItemLevelsQueryKeys.list({ inventoryItemId })
|
|
443
|
-
});
|
|
444
|
-
queryClient.invalidateQueries({
|
|
445
|
-
queryKey: variantsQueryKeys.details()
|
|
446
|
-
});
|
|
447
|
-
options?.onSuccess?.(data, variables, context);
|
|
448
|
-
},
|
|
449
|
-
...options
|
|
450
|
-
});
|
|
451
|
-
};
|
|
452
|
-
var useBatchInventoryItemLocationLevels = (inventoryItemId, options) => {
|
|
453
|
-
return useMutation2({
|
|
454
|
-
mutationFn: (payload) => {
|
|
455
|
-
return sdk.admin.inventoryItems.$id.locationLevels.batch.mutate({
|
|
456
|
-
$id: inventoryItemId,
|
|
457
|
-
...payload,
|
|
458
|
-
// force: true is required for admin batch endpoint to delete levels with stocked items
|
|
459
|
-
force: !!payload?.delete?.length || payload.force
|
|
460
|
-
});
|
|
461
|
-
},
|
|
462
|
-
onSuccess: (data, variables, context) => {
|
|
463
|
-
queryClient.invalidateQueries({
|
|
464
|
-
queryKey: inventoryItemsQueryKeys.lists()
|
|
465
|
-
});
|
|
466
|
-
queryClient.invalidateQueries({
|
|
467
|
-
queryKey: inventoryItemsQueryKeys.detail(inventoryItemId)
|
|
468
|
-
});
|
|
469
|
-
queryClient.invalidateQueries({
|
|
470
|
-
queryKey: inventoryItemLevelsQueryKeys.detail(inventoryItemId)
|
|
471
|
-
});
|
|
472
|
-
queryClient.invalidateQueries({
|
|
473
|
-
queryKey: inventoryItemLevelsQueryKeys.list({ inventoryItemId })
|
|
474
|
-
});
|
|
475
|
-
options?.onSuccess?.(data, variables, context);
|
|
476
|
-
},
|
|
477
|
-
...options
|
|
478
|
-
});
|
|
479
|
-
};
|
|
480
|
-
var useBatchInventoryItemsLocationLevels = (options) => {
|
|
481
|
-
return useMutation2({
|
|
482
|
-
mutationFn: (payload) => {
|
|
483
|
-
return sdk.admin.inventoryItems.locationLevels.batch.mutate({
|
|
484
|
-
...payload,
|
|
485
|
-
// force: true is required for admin batch endpoint to delete levels with stocked items
|
|
486
|
-
force: !!payload?.delete?.length || payload.force
|
|
487
|
-
});
|
|
488
|
-
},
|
|
489
|
-
onSuccess: (data, variables, context) => {
|
|
490
|
-
queryClient.invalidateQueries({
|
|
491
|
-
queryKey: inventoryItemsQueryKeys.all
|
|
492
|
-
});
|
|
493
|
-
queryClient.invalidateQueries({
|
|
494
|
-
queryKey: variantsQueryKeys.lists()
|
|
495
|
-
});
|
|
496
|
-
options?.onSuccess?.(data, variables, context);
|
|
497
|
-
},
|
|
498
|
-
...options
|
|
499
|
-
});
|
|
500
|
-
};
|
|
501
|
-
|
|
502
502
|
export {
|
|
503
503
|
inventoryItemsQueryKeys,
|
|
504
504
|
inventoryItemLevelsQueryKeys,
|
|
@@ -12632,7 +12632,10 @@ var en_default = {
|
|
|
12632
12632
|
upc: "UPC",
|
|
12633
12633
|
shippingProfile: "Shipping profile",
|
|
12634
12634
|
requiredQuantity: "Required quantity",
|
|
12635
|
-
stockStatus: "Stock status"
|
|
12635
|
+
stockStatus: "Stock status",
|
|
12636
|
+
variants: "Variants",
|
|
12637
|
+
variantsCount_one: "{{count}} variant",
|
|
12638
|
+
variantsCount_other: "{{count}} variants"
|
|
12636
12639
|
},
|
|
12637
12640
|
detail: {
|
|
12638
12641
|
offerLabel: "Offer",
|
|
@@ -12641,7 +12644,14 @@ var en_default = {
|
|
|
12641
12644
|
inventoryItems: "Inventory items",
|
|
12642
12645
|
goToInventoryItem: "Go to inventory item",
|
|
12643
12646
|
manageKit: "Inventory kit",
|
|
12644
|
-
noInventoryItems: "This offer has no inventory items linked."
|
|
12647
|
+
noInventoryItems: "This offer has no inventory items linked.",
|
|
12648
|
+
associatedProduct: "Associated product",
|
|
12649
|
+
offerVariant: "Offer Variant",
|
|
12650
|
+
shippingConfiguration: "Shipping Configuration"
|
|
12651
|
+
},
|
|
12652
|
+
delete: {
|
|
12653
|
+
description: "You are about to delete offer {{sku}}. This cannot be undone.",
|
|
12654
|
+
successToast: "Offer was successfully deleted."
|
|
12645
12655
|
},
|
|
12646
12656
|
bulkDelete: {
|
|
12647
12657
|
description: "You are about to delete {{count}} offer(s) from {{storeName}}. This cannot be undone.",
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-4F5GP7J7.js";
|
|
4
4
|
import {
|
|
5
5
|
useDeletePriceListAction
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MHVZVF6O.js";
|
|
7
7
|
import {
|
|
8
8
|
getPriceListStatus
|
|
9
9
|
} from "./chunk-U5MJIHLY.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-OMBP3YSV.js";
|
|
16
16
|
import {
|
|
17
17
|
useProductTableFilters
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RZ5SFALB.js";
|
|
19
19
|
import {
|
|
20
20
|
useProductTableQuery
|
|
21
21
|
} from "./chunk-LYZDVZWA.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
usePriceList,
|
|
31
31
|
usePriceListLinkProducts
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-Z2UBJXTU.js";
|
|
33
33
|
import {
|
|
34
34
|
useCustomerGroups
|
|
35
35
|
} from "./chunk-PRBE5CM3.js";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from "./chunk-INNFZYX2.js";
|
|
43
43
|
import {
|
|
44
44
|
useProducts
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-M2E3PKA4.js";
|
|
46
46
|
|
|
47
47
|
// src/pages/price-lists/price-list-detail/price-list-detail.tsx
|
|
48
48
|
import { Children } from "react";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from "./chunk-46M463BR.js";
|
|
10
10
|
import {
|
|
11
11
|
useCollections
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QKJGSZI2.js";
|
|
13
13
|
import {
|
|
14
14
|
useProductCategories
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KYFWVLWO.js";
|
|
16
16
|
import {
|
|
17
17
|
__toESM
|
|
18
18
|
} from "./chunk-NBMM2TZK.js";
|