import { request } from '@/api/_service'

const BASE = 'quality_control/first_inspection/first_inspection/'

function apiParams (data = {}, method = 'get.quality.category.list', platform = 'api') {
  return { method, platform, ...data }
}
export function fetchInspectionTypeManagementList (data = {}) {
  return request({
    url: BASE + 'category/list',
    method: 'post',
    data: apiParams(data, 'get.quality.category.list', 'api')
  })
}

export function createInspectionTypeManagement (data = {}) {
  return request({
    url: BASE + 'category/add',
    method: 'post',
    data: apiParams(data, 'add.quality.category', 'api')
  })
}

export function editInspectionTypeManagement (data = {}) {
  return request({
    url: BASE + 'category/update',
    method: 'post',
    data: apiParams(data, 'set.quality.category', 'api')
  })
}

export function deleteInspectionTypeManagement (data = {}) {
  return request({
    url: BASE + 'category/delete',
    method: 'post',
    data: apiParams(data, 'del.quality.category', 'api')
  })
}

