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

/**
 * 团队认证-列表
 */

export const A4_APIgetList = (data: any, type: 'live' | 'neighbour'): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/auth/pageList', { ...data, type })
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }
      dispatch({ type: type === 'live' ? 'A4/getList1' : 'A4/getList2', payload: obj })
    }
  }
}

/**
 * 团队认证-删除
 */
export const A4_APIdel = (id: number) => {
  return http.get(`cms/auth/removes/${id}`)
}

/**
 * 团队认证-详情
 */
export const A4_APIgetInfo = (id: number) => {
  return http.get(`cms/auth/detail/${id}`)
}

/**
 * 团队认证-审核
 */
export const A4_APIauth = (id: number, status: number) => {
  return http.get(`cms/auth/update/${id}/${status}`)
}
