import { serviceList, addService, deleteServiceBatch } from '@/api/service'

const service = {
  namespaced: true,

  actions: {
    getServiceList({ commit, state }, data) {
      return new Promise((resolve, reject) => {
        serviceList(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    createService({ commit, state }, data) {
      return new Promise((resolve, reject) => {
        addService(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    deleteService({ commit, state }, data) { // 删除 活动报名人员
      return new Promise((resolve, reject) => {
        deleteServiceBatch(data).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default service
