import { config, networkUtils } from '../../../utils';

const { request } = networkUtils;
const { api } = config;
const { order } = api;
const { stockInOrder } = order;

export async function query(params: object) {
  return request({
    url: stockInOrder,
    method: 'get',
    data: params,
  });
}

export async function getSingle(id: number) {
  return request({
    url: `${stockInOrder}/${id}`,
    method: 'get',
  });
}

export async function create(params: object) {
  return request({
    url: stockInOrder,
    method: 'post',
    data: params,
  });
}

export async function remove(ids: number[]) {
  return request({
    url: stockInOrder,
    method: 'delete',
    data: ids,
  });
}

export async function update(params: object) {
  return request({
    url: `${stockInOrder}/put`,
    method: 'put',
    data: params,
  });
}
