import request from '@/axios'
import { REQUEST_BASE } from '@/constants'

export const getPlanList = (params: any): Promise<IResponse> => {
  return request.get({ url: `${REQUEST_BASE}/decoration/cases`, params })
}
export const getPlanApplyList = (params: any): Promise<IResponse> => {
  return request.get({ url: `${REQUEST_BASE}/decoration/cases_apply`, params })
}
export const addPlan = (data: any): Promise<IResponse> => {
  return request.post({ url: `${REQUEST_BASE}/store`, data })
}
export const applyPlan = (data: any): Promise<IResponse> => {
  return request.put({ url: `${REQUEST_BASE}/decoration/cases/audit/${data.id}`, data })
}

export const editPlan = (data: any): Promise<IResponse> => {
  return request.put({ url: `${REQUEST_BASE}/store/${data.id}`, data })
}

export const delPlan = (id: number): Promise<IResponse> => {
  return request.delete({ url: `${REQUEST_BASE}/store/${id}` })
}

export const recommendPlan = (data: any): Promise<IResponse> => {
  return request.put({
    url: `${REQUEST_BASE}/decoration/cases/recommend/${data.id}/${data.recommend}`
  })
}
