@atomic-solutions/woocommerce-react 0.7.0 → 0.8.0
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/hooks/index.cjs +15 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +15 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/{index-BmWcF7aq.d.ts → index-C6OkRa8P.d.ts} +192 -2
- package/dist/{index-UkshfFwm.d.cts → index-DtuDPfTl.d.cts} +192 -2
- package/dist/index.cjs +15 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/provider/index.d.cts +2 -2
- package/dist/provider/index.d.ts +2 -2
- package/dist/{types-4MW3Y__g.d.cts → types-DABmdACe.d.cts} +1 -0
- package/dist/{types-4MW3Y__g.d.ts → types-DABmdACe.d.ts} +1 -0
- package/package.json +2 -2
package/dist/hooks/index.cjs
CHANGED
|
@@ -369,6 +369,19 @@ var useRemoveCoupon = () => {
|
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
};
|
|
372
|
+
var useUpdateCartExtensions = () => {
|
|
373
|
+
const client = useWooCommerceClient();
|
|
374
|
+
const queryKeys = useWooCommerceQueryKeys();
|
|
375
|
+
const queryClient = reactQuery.useQueryClient();
|
|
376
|
+
return reactQuery.useMutation({
|
|
377
|
+
mutationKey: queryKeys.cart.mutations.updateExtensions(),
|
|
378
|
+
mutationFn: (input) => client.cart.updateExtensions(input),
|
|
379
|
+
onSuccess: (cart) => {
|
|
380
|
+
queryClient.setQueryData(queryKeys.cart.details(), cart);
|
|
381
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.cart.all });
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
};
|
|
372
385
|
var useUpdateCustomer = () => {
|
|
373
386
|
const client = useWooCommerceClient();
|
|
374
387
|
const queryKeys = useWooCommerceQueryKeys();
|
|
@@ -491,6 +504,7 @@ var createQueryKeys = (prefix = ["woocommerce"]) => ({
|
|
|
491
504
|
removeItem: () => [...prefix, "cart", "mutation", "removeItem"],
|
|
492
505
|
applyCoupon: () => [...prefix, "cart", "mutation", "applyCoupon"],
|
|
493
506
|
removeCoupon: () => [...prefix, "cart", "mutation", "removeCoupon"],
|
|
507
|
+
updateExtensions: () => [...prefix, "cart", "mutation", "updateExtensions"],
|
|
494
508
|
updateCustomer: () => [...prefix, "cart", "mutation", "updateCustomer"],
|
|
495
509
|
selectShippingRate: () => [...prefix, "cart", "mutation", "selectShippingRate"]
|
|
496
510
|
}
|
|
@@ -1300,6 +1314,7 @@ exports.useStore = useStore;
|
|
|
1300
1314
|
exports.useStoreFeatures = useStoreFeatures;
|
|
1301
1315
|
exports.useStoreLocale = useStoreLocale;
|
|
1302
1316
|
exports.useStoreTheme = useStoreTheme;
|
|
1317
|
+
exports.useUpdateCartExtensions = useUpdateCartExtensions;
|
|
1303
1318
|
exports.useUpdateCartItem = useUpdateCartItem;
|
|
1304
1319
|
exports.useUpdateCustomer = useUpdateCustomer;
|
|
1305
1320
|
exports.useWooCommerceClient = useWooCommerceClient;
|