1234567891011121314 |
- export const state = () => ({
- items : []
- })
- export const actions = {
- async fetchCourses({commit}) {
- console.log('store/course.js actions > fetchCourses')
- const courses = await this.$axios.$get('/api/v1/products')
- console.log('store/course.js actions > fetchCourses > await this.$axios.$get')
- commit('setItems', {resource: 'course', items: courses}, {root: true})
- console.log('store/course.js actions > fetchCourses > await this.$axios.$get > commit')
- return state.items
- }
- }
|