// Isolates all HTTP requests made to the TaskFlow Express API.
import axios from 'axios';
const api = axios.create({ baseURL: 'http://localhost:5001/api/tasks' });
export const getTasks = async (params = {}) => (await api.get('/', { params })).data;
export const createTask = async (task) => (await api.post('/', task)).data;
export const replaceTask = async (id, task) => (await api.put(`/${id}`, task)).data;
export const patchTask = async (id, updates) => (await api.patch(`/${id}`, updates)).data;
export const removeTask = async (id) => (await api.delete(`/${id}`)).data;11 views