12345678910111213141516171819202122 |
- export const state = () => ({
- item: null
- })
- export const actions = {
- async createHero({commit, state}, courseHeroData) {
- const hero = await this.$axios.$post('/api/v1/product-heroes', courseHeroData)
- if(hero.isAxiosError === true){
- console.log(data.data)
- return Error('')
- }
- commit('setHero', hero)
- return state.item
- }
- }
- export const mutations = {
- setHero(state, hero) {
- state.item = hero
- }
- }
|