Browse Source

added csrftoken to getCart REST call

Bachir Soussi Chiadmi 4 years ago
parent
commit
bd48a7dad8

File diff suppressed because it is too large
+ 0 - 0
web/themes/custom/materiotheme/assets/dist/main.js


+ 4 - 2
web/themes/custom/materiotheme/vuejs/components/Content/Product.vue

@@ -60,7 +60,8 @@ export default {
   computed: {
     ...mapState({
       isloggedin: state => state.User.isloggedin,
-      isAdherent: state => state.User.isAdherent
+      isAdherent: state => state.User.isAdherent,
+      csrftoken: state => state.User.csrftoken
     })
   },
   methods:{
@@ -93,7 +94,8 @@ export default {
       this.addtocart()
     },
     getCarts () {
-      return REST.get(`/cart?_format=json`)
+      // this is bugging on stage
+      return REST.get(`/cart?_format=json`, {}, {'X-CSRF-Token':this.csrftoken})
         // .then(({ data }) => {
         //   console.log('current user carts: data', data)
         // })

Some files were not shown because too many files changed in this diff