import request from '@/config/axios'

// 查询列表-分页
export const getPlacePage = async (params) => {
  return await request.get({ url: '/admin-api/crm/sch-place/page', params })
}

// 查询列表-不分页
export const getPlaceList = async (params) => {
  return await request.get({ url: '/admin-api/crm/sch-place/list', params })
}

// 查询详情
export const getPlace = async (id) => {
  return await request.get({ url: '/admin-api/crm/sch-place/get?id=' + id })
}

// 新增
export const createPlace = async (data) => {
  return await request.post({
    url: '/admin-api/crm/sch-place/create',
    data: data,
    isSubmitForm: true
  })
}

// 修改
export const updatePlace = async (params) => {
  return await request.put({ url: '/admin-api/crm/sch-place/update', data: params })
}

// 删除
export const deletePlace = async (id) => {
  return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
}

export const updatePlaceStatus = async (placeId, status) => {
  const data = {
    placeId,
    status
  }
  return request.put({ url: '/admin-api/crm/sch-place/status/update', data: data })
}
