소스 검색

added csrftoken to getCart REST call

Bachir Soussi Chiadmi 5 년 전
부모
커밋
bd48a7dad8
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 0 0
      web/themes/custom/materiotheme/assets/dist/main.js
  2. 4 2
      web/themes/custom/materiotheme/vuejs/components/Content/Product.vue

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 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)
         // })

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.