@dotdev/next-components
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -13,3 +13,3 @@ import "whatwg-fetch"; | ||
*/ | ||
getCartJSON: () => void; | ||
getCartJSON: () => Promise<any>; | ||
addItem: (id: number, qty: number, properties?: any) => Promise<void>; | ||
@@ -16,0 +16,0 @@ addItems: (items: Array<{ |
@@ -71,16 +71,21 @@ "use strict"; | ||
*/ | ||
this.getCartJSON = function () { | ||
axios_1.default.get("/cart?view=json&x=" + Math.random(), { | ||
headers: { | ||
"X-Requested-With": "XMLHttpRequest", | ||
"Content-Type": "application/json;", | ||
"Cache-Control": "no-cache", | ||
"cache": "no-cache", | ||
}, | ||
}) | ||
.then(function (_a) { | ||
var data = _a.data; | ||
_this.context.update({ cart: data }); | ||
this.getCartJSON = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, axios_1.default.get("/cart?view=json&x=" + Math.random(), { | ||
headers: { | ||
"X-Requested-With": "XMLHttpRequest", | ||
"Content-Type": "application/json;", | ||
"Cache-Control": "no-cache", | ||
"cache": "no-cache", | ||
}, | ||
})]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
this.context.update({ cart: data }); | ||
return [2 /*return*/, data]; | ||
} | ||
}); | ||
}; | ||
}); }; | ||
this.addItem = function (id, qty, properties) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -87,0 +92,0 @@ var response, err_1; |
{ | ||
"name": "@dotdev/next-components", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"license": "SEE LICENSE IN LICENCE.md", | ||
@@ -5,0 +5,0 @@ "description": "Common components for Next projects", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140663
2059