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

export default async function deleteTask(taskId) {
    const csrfToken = await getXSRFToken();

    return fetchWrapper(
        `/api/events/tasks/${taskId}`,
        { task_id: taskId },
        "DELETE",
        { "X-XSRF-TOKEN": csrfToken }
    );
}
