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

export default async function assignOtherUser(taskId: number, userId: number): Promise<any> {
    const csrfToken = await getXSRFToken();

    return fetchWrapper(
        `/api/events/task/assign/${userId}`,
        {task_id: taskId},
        "POST",
        {"X-XSRF-TOKEN": csrfToken}
    );
}
