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

const { api } = config
const { quality } = api
const { co } = quality

export async function query(params) {
  return networkUtils.request({
    url: co,
    method: 'get',
    data: params,
  })
}

export async function getSingle(id) {
  return networkUtils.request({
    url: `${co}/${id}`,
    method: 'get',
  })
}

export async function create(params) {
  return networkUtils.request({
    url: co,
    method: 'post',
    data: params,
  })
}

export async function remove(id) {
  return networkUtils.request({
    url: `${co}/del/${id}`,
    method: 'post',
  })
}

export async function update(params) {
  return networkUtils.request({
    url: `${co}/put`,
    method: 'post',
    data: params,
  })
}

export async function qualityCheck(id) {
  return networkUtils.request({
    url: `${co}/qac/${id}`,
    method: 'get',
  })
}
