ingeniuscliq-core 0.5.30 → 0.5.31
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/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts.map +1 -1
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +2 -2
- package/dist/modules/CoreShopCart/services/base.d.ts +1 -1
- package/dist/modules/CoreShopCart/services/base.d.ts.map +1 -1
- package/dist/modules/CoreShopCart/services/base.js +3 -2
- package/dist/modules/CoreShopCart/types/interfaces/CartActions.d.ts +1 -1
- package/dist/modules/CoreShopCart/types/interfaces/CartActions.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreShopCartBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShopCart/classes/CoreShopCartBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,mBAAmB,CAAC,CAAC,EAAE,MAAM,SAAS,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC7H,SAAS,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;IACtD,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAG/E,OAAO,GAAE,uBAAuB,CAAC,CAAC,CAAoC,EACtE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAoBhC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"CoreShopCartBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShopCart/classes/CoreShopCartBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,qBAAa,mBAAmB,CAAC,CAAC,EAAE,MAAM,SAAS,iBAAiB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,MAAM,CAAC;IAC7H,SAAS,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;IACtD,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;gBAG/E,OAAO,GAAE,uBAAuB,CAAC,CAAC,CAAoC,EACtE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;IAoBhC,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM;IAkK3C,KAAK;;;;;;;;;;;;;;;;;CAeb"}
|
|
@@ -56,10 +56,10 @@ class CoreShopCartBuilder extends CoreBaseBuilder {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
// Remove one unit from cart
|
|
59
|
-
removeFromCart: async (product_id, actions) => {
|
|
59
|
+
removeFromCart: async (product_id, quantity = 1, actions) => {
|
|
60
60
|
set({ loading: true, error: null });
|
|
61
61
|
try {
|
|
62
|
-
await this.shopCartService.removeFromCart(product_id);
|
|
62
|
+
await this.shopCartService.removeFromCart(product_id, quantity);
|
|
63
63
|
const response = await this.shopCartService.getCart();
|
|
64
64
|
set({
|
|
65
65
|
cart: response.data.data,
|
|
@@ -14,7 +14,7 @@ export declare class CoreShopCartBaseService<T> extends BaseService implements I
|
|
|
14
14
|
/**
|
|
15
15
|
* Remove one unit of product from cart
|
|
16
16
|
*/
|
|
17
|
-
removeFromCart(product_id: string | number): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreShopCart<T>>, any>>;
|
|
17
|
+
removeFromCart(product_id: string | number, quantity?: number): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreShopCart<T>>, any>>;
|
|
18
18
|
/**
|
|
19
19
|
* Remove entire product item from cart
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShopCart/services/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAU3E;;GAEG;AACH,qBAAa,uBAAuB,CAAC,CAAC,CAAE,SAAQ,WAAY,YAAW,mBAAmB,CAAC,CAAC,CAAC;;IAK3F;;OAEG;IACI,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO9D;;OAEG;IACI,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreShopCart/services/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAU3E;;GAEG;AACH,qBAAa,uBAAuB,CAAC,CAAC,CAAE,SAAQ,WAAY,YAAW,mBAAmB,CAAC,CAAC,CAAC;;IAK3F;;OAEG;IACI,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO9D;;OAEG;IACI,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,GAAE,MAAU;IAOvE;;OAEG;IACI,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAMrD;;OAEG;IACI,SAAS;IAIhB;;OAEG;IACI,YAAY;IAInB;;OAEG;IACI,OAAO;CAGf"}
|
|
@@ -17,9 +17,10 @@ class CoreShopCartBaseService extends BaseService {
|
|
|
17
17
|
/**
|
|
18
18
|
* Remove one unit of product from cart
|
|
19
19
|
*/
|
|
20
|
-
removeFromCart(product_id) {
|
|
20
|
+
removeFromCart(product_id, quantity = 1) {
|
|
21
21
|
return this.api.put(SHOP_CART_REMOVE_FROM_CART, {
|
|
22
|
-
product_id
|
|
22
|
+
product_id,
|
|
23
|
+
quantity
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
@@ -4,7 +4,7 @@ import { BaseApiResponse } from '../../../../types/contracts/BaseApiResponse';
|
|
|
4
4
|
import { CoreActions } from '../../../../types';
|
|
5
5
|
export interface ICartActions<T> {
|
|
6
6
|
addToCart: (product_id: string | number, quantity: number, actions?: CoreActions) => void;
|
|
7
|
-
removeFromCart: (product_id: string | number, actions?: CoreActions) => void;
|
|
7
|
+
removeFromCart: (product_id: string | number, quantity?: number, actions?: CoreActions) => void;
|
|
8
8
|
removeItemFromCart: (product_id: string | number, actions?: CoreActions) => void;
|
|
9
9
|
clearCart: (actions?: CoreActions) => void;
|
|
10
10
|
getCart: () => CoreShopCart<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartActions.d.ts","sourceRoot":"","sources":["../../../../../src/modules/CoreShopCart/types/interfaces/CartActions.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