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

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

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

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

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

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

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