import service from '@/utils/apiService'

const baseUrl = '/api/roles'

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

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

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

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

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

export function lookupAll() {
  return service({
    url: `${baseUrl}/lookup/all`,
    method: 'get'
  })
}
