import { AxiosRequestConfig } from "axios";
import axiosInstance from "../http/axiosInstance";
import { IRoleCreate } from "../interfaces/role";
import { BASE_URL } from "../constants";

const config: AxiosRequestConfig = {
    baseURL: BASE_URL.auth
}

export default class RoleService {
    static async getRoles() {
        return await axiosInstance.get(`/auth/roles`, config)
    }

    static async createRole(data: IRoleCreate) {
        return await axiosInstance.post(`/auth/roles/`, data, config)
    }


    static async getRoleById(id: number) {
        return await axiosInstance.get(`/auth/roles/${id}`, config)
    }

    // static async deleteRole(id: number) {
    //     return await axiosInstance.delete(`/auth/roles/${id}`)
    // }
}