import service from '@/utils/apiService'
const baseUrl = '/api/section-areas'

export function getArea(id) {
  return service({
    url: `${baseUrl}/${id}`,
    method: 'get'
  })
}

export function getAreas(params) {
  return service({
    url: `${baseUrl}`,
    method: 'get',
    params
  })
}

export function createArea(data) {
  return service({
    url: `${baseUrl}`,
    method: 'post',
    data
  })
}

export function updateArea(id, data) {
  return service({
    url: `${baseUrl}/${id}`,
    method: 'put',
    data
  })
}

export function deleteArea(id) {
  return service({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function lookupBySection(sectionId) {
  return service({
    url: `${baseUrl}/lookup/by-section/${sectionId}`,
    method: 'get'
  })
}
