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

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

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

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

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

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

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