import request from '@/utils/request'

export function getUnitList(query) {
  return request({
    url: '/project/unit/',
    method: 'get',
    params: query
  })
}

export function createUnit(data) {
  return request({
    url: '/project/unit/',
    method: 'post',
    data
  })
}

export function deleteUnit(id) {
  return request({
    url: `/project/unit/${id}/`,
    method: 'delete'
  })
}


export function updateUnit(id, data) {
  return request({
    url: `/project/unit/${id}/`,
    method: 'put',
    data
  })
}

export function getUnit(id) {
  return request({
    url: `/project/unit/${id}/`,
    method: 'get',
  })
}
