import { useDocumentApi } from "../../api/documentApi.js";

const { postDocument } = useDocumentApi();

export const addDocument = async (stageId, file, name = "", description = "") => {
    const formData = new FormData();
    
    formData.append("document", file);
    formData.append("stage_id", stageId);
    formData.append("name", name);
    formData.append("description", description);

    const response = await postDocument(formData);
    return response;
}