@dotdev/next-components
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -8,2 +8,7 @@ import "whatwg-fetch"; | ||
triggerPaymentButtons: () => void; | ||
/** | ||
* TODO: I have switched this to use axios because there were caching issues on older versions of | ||
* Safari (v11.1). It would make sense to switch all requests to use axios but I haven't done so | ||
* far as I do not have time to test the other requests are still working. | ||
*/ | ||
getCartJSON: () => void; | ||
@@ -10,0 +15,0 @@ addItem: (id: number, qty: number, properties?: any) => Promise<void>; |
@@ -53,2 +53,3 @@ "use strict"; | ||
require("whatwg-fetch"); | ||
var axios_1 = require("axios"); | ||
var Cart = /** @class */ (function () { | ||
@@ -66,4 +67,9 @@ function Cart() { | ||
}; | ||
/** | ||
* TODO: I have switched this to use axios because there were caching issues on older versions of | ||
* Safari (v11.1). It would make sense to switch all requests to use axios but I haven't done so | ||
* far as I do not have time to test the other requests are still working. | ||
*/ | ||
this.getCartJSON = function () { | ||
fetch("/cart?view=json&x=" + Math.random(), { | ||
axios_1.default.get("/cart?view=json&x=" + Math.random(), { | ||
headers: { | ||
@@ -75,6 +81,7 @@ "X-Requested-With": "XMLHttpRequest", | ||
}, | ||
method: "GET" | ||
}) | ||
.then(function (response) { return response.json(); }) | ||
.then(function (data) { return _this.context.update({ cart: data }); }); | ||
.then(function (_a) { | ||
var data = _a.data; | ||
_this.context.update({ cart: data }); | ||
}); | ||
}; | ||
@@ -81,0 +88,0 @@ this.addItem = function (id, qty, properties) { return __awaiter(_this, void 0, void 0, function () { |
{ | ||
"name": "@dotdev/next-components", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"license": "SEE LICENSE IN LICENCE.md", | ||
@@ -10,2 +10,3 @@ "description": "Common components for Next projects", | ||
"@shopify/theme-cart": "^1.0.1", | ||
"axios": "^0.20.0", | ||
"moment": "^2.23.0", | ||
@@ -12,0 +13,0 @@ "numeral": "^2.0.6", |
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
140273
2054
12
12
+ Addedaxios@^0.20.0
+ Addedaxios@0.20.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)