import request from '@/utils/request';

export function getRoutes() {
  return request({
    url: '/routes',
    method: 'get'
  });
}

export function immaditeLoadRoles() {
  return request({
    url: '/core/roles/immediateLoad',
    method: 'get'
  });
}

export function addRole(data) {
  return request({
    url: '/role',
    method: 'post',
    data
  });
}

export function updateRole(id, data) {
  return request({
    url: `/role/${id}`,
    method: 'put',
    data
  });
}

export function deleteRole(id) {
  return request({
    url: `/role/${id}`,
    method: 'delete'
  });
}
