import { axiosClient } from '../../../api/axiosClient'
import type { RolDto, UpdateRolRequest } from './types'

export async function updateRole(codigo: string, payload: UpdateRolRequest): Promise<RolDto> {
  const response = await axiosClient.put<RolDto>(
    `/api/v1/roles/${encodeURIComponent(codigo)}`,
    payload,
  )
  return response.data
}
