{"size": 717, "ext": "js", "max_stars_repo_path": "resources/js/service/TaskService.js", "max_stars_repo_name": "Rakibul3316/Laravel-React-Advanced-CRUD", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/service/TaskService.js", "max_issues_repo_name": "Rakibul3316/Laravel-React-Advanced-CRUD", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/js/service/TaskService.js", "max_forks_repo_name": "Rakibul3316/Laravel-React-Advanced-CRUD", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.5769230769, "max_line_length": 73, "alphanum_fraction": 0.5411436541}
import Axios from "axios";

export const storeNewTask = async (data) => {
    // console.log('data :>> ', data);
    // return false;
    // data.user_id = 1;
    data.project_id = parseInt(data.project_id);
    return await Axios.post('http://127.0.0.1:8000/api/tasks', data)
        .then((res) => {
            return res.data;
        });
}

export const updateTask = async (id, data) => {
    return await Axios.put(`http://127.0.0.1:8000/api/tasks/${id}`, data)
        .then((res) => {
            return res.data;
        });
}

export const deleteTask = async (id) => {
    return await Axios.delete(`http://127.0.0.1:8000/api/tasks/${id}`)
        .then((res) => {
            return res.data;
        });
}