import client from './client';
import { API_ENDPOINTS } from './ApiSources';


/**
 * Create a new task
 * @param {Object} taskData - Task data
 * @param {string} taskData.title - Task title
 * @param {string} taskData.description - Task description
 * @param {string} taskData.priority - Task priority
 * @param {string} taskData.status - Task status
 * @param {string} taskData.due_date - Task due date
 * @returns {Promise<Object>} Created task data
 */
export const createTask = async (taskData) => {
    try {
        const response = await client.post(API_ENDPOINTS.TASKS.CREATE, taskData);
        return response.data;
    } catch (error) {
        throw error.response?.data || error.message;
    }
};