import fetchWrapper from "../fetchWrapper";
import getXSRFToken from "../getXSRF";

export default async function modifyRole(role:number, userId:number) {
    const csrfToken = await getXSRFToken();

    return fetchWrapper(
        `/api/users/${userId}/role`,
        { role },
        "POST",
        { "X-XSRF-TOKEN": csrfToken }
    );
}
