From 9b1c407ca0e4686c84d803b4b7c6f7aabd5b21d4 Mon Sep 17 00:00:00 2001 From: Roy Duineveld Date: Wed, 8 Nov 2023 14:18:03 +0100 Subject: [PATCH 1/5] Updated the callback params --- resources/js/callbacks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/callbacks.js b/resources/js/callbacks.js index 976bdf6..42b55e1 100644 --- a/resources/js/callbacks.js +++ b/resources/js/callbacks.js @@ -25,7 +25,7 @@ Vue.prototype.reorderCallback = async function (variables, response) { await GetCart.methods.refreshCart() } -Vue.prototype.sortOrdersCallback = async function (response) { +Vue.prototype.sortOrdersCallback = async function (data, response) { response.data.data.customer.orders.items.sort((a,b) => { return new Date(b.order_date) - new Date(a.order_date) }) From bcc8c3954a561605cae2a109eaa778f51e9c93c7 Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:08:00 +0100 Subject: [PATCH 2/5] Remove obsolete .data --- resources/js/callbacks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/callbacks.js b/resources/js/callbacks.js index 42b55e1..5c90276 100644 --- a/resources/js/callbacks.js +++ b/resources/js/callbacks.js @@ -26,7 +26,7 @@ Vue.prototype.reorderCallback = async function (variables, response) { } Vue.prototype.sortOrdersCallback = async function (data, response) { - response.data.data.customer.orders.items.sort((a,b) => { + response.data.customer.orders.items.sort((a,b) => { return new Date(b.order_date) - new Date(a.order_date) }) From e978dacbd5704003185b8808e5f272293550f9c8 Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:07:07 +0100 Subject: [PATCH 3/5] Remove getCart --- resources/js/callbacks.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/js/callbacks.js b/resources/js/callbacks.js index 5c90276..dac9942 100644 --- a/resources/js/callbacks.js +++ b/resources/js/callbacks.js @@ -1,12 +1,13 @@ import 'Vendor/rapidez/core/resources/js/vue' import InteractWithUser from 'Vendor/rapidez/core/resources/js/components/User/mixins/InteractWithUser' -import GetCart from 'Vendor/rapidez/core/resources/js/components/Cart/mixins/GetCart' +import { mask } from 'Vendor/rapidez/core/resources/js/stores/useMask' +import { cart, linkUserToCart, refresh as refreshCart } from 'Vendor/rapidez/core/resources/js/stores/useCart' Vue.prototype.registerCallback = async function (variables, response) { await InteractWithUser.methods.login(variables.email, variables.password) await InteractWithUser.methods.refreshUser() - if (localStorage.cart && localStorage.mask) { - await GetCart.methods.linkUserToCart() + if (cart?.value?.id && mask) { + await linkUserToCart() } } @@ -22,7 +23,7 @@ Vue.prototype.reorderCallback = async function (variables, response) { document.removeEventListener('turbo:load', showReorderErrors) }) - await GetCart.methods.refreshCart() + await refreshCart() } Vue.prototype.sortOrdersCallback = async function (data, response) { From 943014cf8ba29ed51c668f3e0a66acc2d1be9050 Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Wed, 21 Feb 2024 13:57:40 +0100 Subject: [PATCH 4/5] Require Rapidez 1.14 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 06c5a7c..452664a 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "php": "^8.0|^8.1", "illuminate/support": "^9.0|^10.0", "illuminate/view": "^9.0|^10.0", - "rapidez/core": "~0.91|^1.0" + "rapidez/core": "^1.14" }, "autoload": { "psr-4": { From 4e1e16a97cb0cf12c8b6ba82a202ccb03c8cb03f Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:02:34 +0100 Subject: [PATCH 5/5] Require Rapidez 2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 452664a..1f3624a 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "php": "^8.0|^8.1", "illuminate/support": "^9.0|^10.0", "illuminate/view": "^9.0|^10.0", - "rapidez/core": "^1.14" + "rapidez/core": "^2.0" }, "autoload": { "psr-4": {