import axios from "axios"

const baseUrl = "/api/security-management"
export class RoleService {
    getData(params = {}) {
        return axios({
            baseURL: baseUrl,
            url: "/roles",
            method: "get",
            params:params
        })
    }

    create(data) {
        return axios({
            baseURL:baseUrl,
            url:"/roles",
            method:"post",
            data:data
        })
    }

    show(id) {
        return axios({
            baseURL:baseUrl,
            url:"/roles/"+id,
            method:"get"
        })
    }

    update(id,data) {
        return axios({
            baseURL:baseUrl,
            url:"/roles/"+id,
            method:"post",
            data:data
        })
    }

    delete(data) {
        return axios({
            baseURL:baseUrl,
            url:"/roles/remove",
            method:"post",
            data:data
        })
    }

    getSelection(){
        return axios({
            baseURL:baseUrl,
            url:"/selections/role-module"
        })
    }
}