@springmicro/cart 0.7.11 → 0.7.12

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@springmicro/cart",
3
3
  "private": false,
4
- "version": "0.7.11",
4
+ "version": "0.7.12",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@nanostores/persistent": "^0.10.1",
25
25
  "@nanostores/query": "^0.3.3",
26
26
  "@nanostores/react": "^0.7.2",
27
- "@springmicro/utils": "^0.7.11",
27
+ "@springmicro/utils": "^0.7.12",
28
28
  "dotenv": "^16.4.5",
29
29
  "nanostores": "^0.10.3",
30
30
  "react": "^18.2.0",
@@ -49,5 +49,5 @@
49
49
  "vite-plugin-css-injected-by-js": "^3.5.1",
50
50
  "yup": "^1.4.0"
51
51
  },
52
- "gitHead": "83e40d99497f8016d112147e64bf69f9ae852d6d"
52
+ "gitHead": "fd84f6ddb8ef2f0e9ec15c7078bfd8a4d65e864b"
53
53
  }
@@ -215,18 +215,23 @@ export default function ReviewAndCalculateTaxes({
215
215
  invoiceId
216
216
  )
217
217
  .then(async (data) => {
218
- dev && console.log("Checkout submitted");
218
+ dev && console.log("Checkout submitted.", data);
219
+
219
220
  if (data instanceof Response) {
220
221
  setFormError(true);
221
222
  const { detail: errorData } = await data.json();
222
- // dev && alert(data.statusText);
223
- // console.log(errorData);
224
- // TODO display issues
225
- if (!errorData.valid) setPrecheckErrors(errorData.errors);
223
+
224
+ if (!errorData.valid) {
225
+ dev && console.log("Precheck invalid", errorData);
226
+ setPrecheckErrors(errorData.errors);
227
+ }
226
228
  } else {
229
+ dev && console.log("Checkout returned status code 200");
230
+
227
231
  // success
228
232
  setSuccessData(data);
229
233
  onPlacement && onPlacement();
234
+
230
235
  // Get the current URL
231
236
  const currentUrl = new URL(window.location.href);
232
237
  // Set the query parameter 'showReceipt' to '1'
@@ -349,7 +354,9 @@ export default function ReviewAndCalculateTaxes({
349
354
 
350
355
  // const res = await submitFunc(values);
351
356
  submitFunc(values)
352
- .then((v) => {})
357
+ .then((v) => {
358
+ dev && console.log("Submit success", v);
359
+ })
353
360
  .catch((e) => {
354
361
  dev && console.log("Submit errors", e);
355
362
  });