ingeniuscliq-core 0.3.46 → 0.3.47

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.js CHANGED
@@ -2528,7 +2528,7 @@ class J5 {
2528
2528
  addToCart: async (r, o, { onSuccess: a = () => {
2529
2529
  }, onError: s = () => {
2530
2530
  }, onFinish: i = () => {
2531
- } }) => {
2531
+ } } = {}) => {
2532
2532
  try {
2533
2533
  t({ loading: !0, error: null }), await this.shopCartService.addToCart(r, o);
2534
2534
  let c = await this.shopCartService.getCart();
@@ -2542,7 +2542,7 @@ class J5 {
2542
2542
  removeFromCart: async (r, { onSuccess: o = () => {
2543
2543
  }, onError: a = () => {
2544
2544
  }, onFinish: s = () => {
2545
- } }) => {
2545
+ } } = {}) => {
2546
2546
  try {
2547
2547
  t({ loading: !0, error: null }), await this.shopCartService.removeFromCart(r);
2548
2548
  let i = await this.shopCartService.getCart();
@@ -2556,7 +2556,7 @@ class J5 {
2556
2556
  removeItemFromCart: async (r, { onSuccess: o = () => {
2557
2557
  }, onError: a = () => {
2558
2558
  }, onFinish: s = () => {
2559
- } }) => {
2559
+ } } = {}) => {
2560
2560
  try {
2561
2561
  t({ loading: !0, error: null }), await this.shopCartService.removeItemFromCart(r);
2562
2562
  let i = await this.shopCartService.getCart();
@@ -2570,7 +2570,7 @@ class J5 {
2570
2570
  clearCart: async ({ onSuccess: r = () => {
2571
2571
  }, onError: o = () => {
2572
2572
  }, onFinish: a = () => {
2573
- } }) => {
2573
+ } } = {}) => {
2574
2574
  try {
2575
2575
  t({ loading: !0, error: null }), await this.shopCartService.clearCart();
2576
2576
  let s = await this.shopCartService.getCart();
@@ -2592,7 +2592,7 @@ class J5 {
2592
2592
  fetchCart: async ({ onSuccess: r = () => {
2593
2593
  }, onError: o = () => {
2594
2594
  }, onFinish: a = () => {
2595
- } }) => {
2595
+ } } = {}) => {
2596
2596
  try {
2597
2597
  t({ loading: !0, error: null });
2598
2598
  let s = await this.shopCartService.getCart();
@@ -2606,7 +2606,7 @@ class J5 {
2606
2606
  fetchCartItems: async ({ onSuccess: r = () => {
2607
2607
  }, onError: o = () => {
2608
2608
  }, onFinish: a = () => {
2609
- } }) => {
2609
+ } } = {}) => {
2610
2610
  try {
2611
2611
  t({ loading: !0, error: null });
2612
2612
  let s = await this.shopCartService.getCartItems();
@@ -3,16 +3,16 @@ import { CoreShopCart, CoreCartItem } from '../CoreShopCart';
3
3
  import { BaseApiResponse } from '../../../../types/contracts/BaseApiResponse';
4
4
  import { CoreActions } from '../../../../types';
5
5
  export interface ICartActions<T> {
6
- addToCart: (product_id: string | number, quantity: number, actions: CoreActions) => void;
7
- removeFromCart: (product_id: string | number, actions: CoreActions) => void;
8
- removeItemFromCart: (product_id: string | number, actions: CoreActions) => void;
9
- clearCart: (actions: CoreActions) => void;
6
+ addToCart: (product_id: string | number, quantity: number, actions?: CoreActions) => void;
7
+ removeFromCart: (product_id: string | number, actions?: CoreActions) => void;
8
+ removeItemFromCart: (product_id: string | number, actions?: CoreActions) => void;
9
+ clearCart: (actions?: CoreActions) => void;
10
10
  getCart: () => CoreShopCart<T>;
11
11
  setCart: (cart: CoreShopCart<T>) => void;
12
12
  getCartItems: () => CoreCartItem<T>[];
13
13
  setCartItems: (cartItems: CoreCartItem<T>[]) => void;
14
- fetchCart: (actions: CoreActions) => Promise<BaseApiResponse<CoreShopCart<T>>>;
15
- fetchCartItems: (actions: CoreActions) => Promise<BaseApiResponse<CoreCartItem<T>[]>>;
14
+ fetchCart: (actions?: CoreActions) => Promise<BaseApiResponse<CoreShopCart<T>>>;
15
+ fetchCartItems: (actions?: CoreActions) => Promise<BaseApiResponse<CoreCartItem<T>[]>>;
16
16
  }
17
17
  export interface ICartActionsService<T> {
18
18
  addToCart: (product_id: string | number, quantity: number) => Promise<AxiosResponse<BaseApiResponse<CoreCartItem<T>>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.3.46",
3
+ "version": "0.3.47",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",