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

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

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