import http from '@/utils/request'

export function listUsers () {
  return http.get('/system/users')
}

export function createUser (data) {
  return http.post('/system/users', data)
}

export function updateUser (id, data) {
  return http.put(`/system/users/${id}`, data)
}

export function updateUserRoles (id, roles) {
  return http.put(`/system/users/${id}/roles`, { roles })
}
