display product list, rest addtocart
This commit is contained in:
@@ -5,6 +5,7 @@ import User from './modules/user'
|
||||
import Search from './modules/search'
|
||||
import Blabla from './modules/blabla'
|
||||
import Showrooms from './modules/showrooms'
|
||||
import Pages from './modules/pages'
|
||||
|
||||
// https://github.com/vuejs/vuex/tree/dev/examples/shopping-cart
|
||||
|
||||
@@ -15,6 +16,7 @@ export default new Vuex.Store({
|
||||
User,
|
||||
Search,
|
||||
Blabla,
|
||||
Showrooms
|
||||
Showrooms,
|
||||
Pages
|
||||
}
|
||||
})
|
||||
|
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