const URL = "/one-api/mockup/masterdata/";

export async function lookup(prm) {
    try {
        var resp = await axios.post(URL + 'priviledge/lookuppriviledge', prm);
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.statusText
            };
        }
        let data = resp.data;
        return data;
    } catch (e) {
        return {
            status: "ERR",
            message: e.message
        };
    }
}

export async function save(token,prm) {
    try {
        var resp = await axios.post(URL + 'priviledge/save', {token:token,datas:prm});
        if (resp.status != 200) {
            return {
                status: "ERR",
                message: resp.statusText
            };
        }
        let data = resp.data;
        return data;
    } catch (e) {
        return {
            status: "ERR",
            message: e.message
        };
    }
}
