display product list, rest addtocart
This commit is contained in:
38
web/themes/custom/materiotheme/vuejs/store/modules/pages.js
Normal file
38
web/themes/custom/materiotheme/vuejs/store/modules/pages.js
Normal 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)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user