display product list, rest addtocart

This commit is contained in:
2019-10-05 20:01:06 +02:00
parent f5e18e9c20
commit ebb20c6176
30 changed files with 1403 additions and 10 deletions

View File

@@ -0,0 +1,38 @@
import { JSONAPI } from 'vuejs/api/json-axios'
import { REST } from 'vuejs/api/rest-axios'
import { MA } from 'vuejs/api/ma-axios'
import qs from 'querystring'
export default {
namespaced: true,
// initial state
state : {
pricing: {},
},
// getters
getters : {},
// mutations
mutations : {
setPricing (state, page) {
state.pricing = page
}
},
// actions
actions : {
getPricing({ dispatch, commit, state }){
REST.get(`/pricing_rest?_format=json`, {})
.then(({ data }) => {
console.log('pricing REST: data', data)
commit('setPricing',data)
})
.catch(( error ) => {
console.warn('Issue with pricing', error)
Promise.reject(error)
})
}
}
}