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

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

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