import request from '@/utils/request'

export function fetchRentalList(query) {
  return request({
    url: '/rentals',
    method: 'get',
    params: query
  })
}

export function obtainedRental(ids) {
  return request({
    url: '/rental/obtained',
    method: 'post',
    data: {
      idArray: ids
    }
  })
}

export function shelfRental(ids) {
  return request({
    url: '/rental/shelf',
    method: 'post',
    data: {
      idArray: ids
    }
  })
}

export function addRental(listQuery) {
  return request({
    url: '/rental/add',
    method: 'post',
    data: listQuery
  })
}

export function updateRental(listQuery) {
  return request({
    url: '/rental/update',
    method: 'post',
    data: listQuery
  })
}

export function getRental(id) {
  return request({
    url: '/rental/get/' + id,
    method: 'get'
  })
}
