import ajax from '../../util/ajax'
import api from '../../util/api'

export default {
  namespaced: true,
  state: {
    tagList: [],
  },
  mutations: {
    updateList (state, payload) {
      state.tagList = payload || []
    },
  },
  actions: {
    GetCourseTagList ({ commit }, payload) {
      ajax(api.course.tags.url, {
        method: api.course.tags.method,
        queryData: {
          ...payload,
        }
      }).then(res => {
        commit('updateList', res)
      })
    },
  },
}
