From ac49e9126454750e2fd77c4e04d09f2843609d34 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 25 Jul 2021 01:40:43 +0200 Subject: Sort cart in getter. --- client/src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/src') diff --git a/client/src/store/index.js b/client/src/store/index.js index 2454977..3d612c7 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -11,7 +11,7 @@ export default createStore({ return state.products; }, getCart(state) { - return state.cart; + return state.cart.sort((x, y) => x.name > y.name); }, getCartSize(state) { let sum = 0; -- cgit v1.2.3