pages.js 769 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { JSONAPI } from 'vuejs/api/json-axios'
  2. import { REST } from 'vuejs/api/rest-axios'
  3. import { MA } from 'vuejs/api/ma-axios'
  4. import qs from 'querystring-es3'
  5. export default {
  6. namespaced: true,
  7. // initial state
  8. state: {
  9. pricing: {}
  10. },
  11. // getters
  12. getters: {},
  13. // mutations
  14. mutations: {
  15. setPricing (state, page) {
  16. state.pricing = page
  17. }
  18. },
  19. // actions
  20. actions: {
  21. getPricing ({ dispatch, commit, state }) {
  22. REST.get('/pricing_rest?_format=json', {})
  23. .then(({ data }) => {
  24. console.log('pricing REST: data', data)
  25. commit('setPricing', data)
  26. })
  27. .catch((error) => {
  28. console.warn('Issue with pricing', error)
  29. Promise.reject(error)
  30. })
  31. }
  32. }
  33. }