import http from '@/utils/http'
import { AppDispatch } from '..'

/**
 * 课程预约记录-列表
 */

export const A6_APIgetList = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/apply/pageList', data)
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }
      dispatch({ type: 'A6/getList', payload: obj })
    }
  }
}

/**
 * 课程预约记录-删除
 */
export const A6_APIdel = (id: number) => {
  return http.get(`cms/apply/removes/${id}`)
}

/**
 * 课程预约记录-审核
 */
export const A6_APIauth = (id: number, status: number) => {
  return http.get(`cms/apply/update/${id}/${status}`)
}
