import http from '@/utils/request'

// 获取节目列表
export function getPerformList (params) {
  // eslint-disable-next-line prefer-const
  let { pageNum = 1, pageSize = 10, status = ['inactive', 'active'] } = params
  status = status.map(val => {
    return `status=${val}`
  }).join('&')
  return http.get(`perform/?pageSize=${params.pageSize !== undefined ? params.pageSize : 10}&pageNum=${pageNum}&pageSize=${pageSize}&${status}`)
}

export function getperformById (id) {
  return http.get(`perform/${id}`)
}

// 编辑节目
export function updatePerform (id, params) {
  return http.put(`perform/${id}`, params)
}
