aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-07-25 01:40:43 +0200
committerMateja <mail@matejamaric.com>2021-07-25 01:40:43 +0200
commitac49e9126454750e2fd77c4e04d09f2843609d34 (patch)
treebba041e9e9b5ca290671aaa3e964aa948e5087c0 /client
parenta3614f5fdb7de39d88846a37b7ea7d816b7765cc (diff)
downloadmevn-ecommerce-ac49e9126454750e2fd77c4e04d09f2843609d34.tar.gz
mevn-ecommerce-ac49e9126454750e2fd77c4e04d09f2843609d34.zip
Sort cart in getter.
Diffstat (limited to 'client')
-rw-r--r--client/src/store/index.js2
1 files changed, 1 insertions, 1 deletions
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;