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

@@ -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
}
})

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)
})
}
}
}