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

const BASE = 'quality_control/first_inspection/first_inspection/'

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

export function createFirstArticleInspectionConfiguration (data = {}) {
  return request({
    url: BASE + 'add',
    method: 'post',
    data: apiParams(data, 'add.setting', 'admin')
  })
}

export function editFirstArticleInspectionConfiguration (data = {}) {
  return request({
    url: BASE + 'update',
    method: 'post',
    data: apiParams(data, 'set.setting', 'admin')
  })
}

export function deleteFirstArticleInspectionConfiguration (data = {}) {
  return request({
    url: BASE + 'delete',
    method: 'post',
    data: apiParams(data, 'del.setting.list', 'admin')
  })
}

