diff --git a/src/api/sendPdf.js b/src/api/sendPdf.js index 5b5c347..01c0409 100644 --- a/src/api/sendPdf.js +++ b/src/api/sendPdf.js @@ -1,14 +1,14 @@ import axios from "axios"; // Function to upload multiple images to the backend -export async function uploadPdfs(pdfs) { +export async function uploadPdfs(pdfs, isImageContained) { const formData = new FormData(); pdfs.forEach((pdf) => { formData.append("pdfs", pdf); }); try { - const response = await axios.post("/uploadpdf", formData, { + const response = await axios.post(`/uploadpdf?isImageContained=${isImageContained}`, formData, { headers: { "Content-Type": "multipart/form-data", }, diff --git a/src/layouts/upload/inputPDF.js b/src/layouts/upload/inputPDF.js index cbb481d..03eadd3 100644 --- a/src/layouts/upload/inputPDF.js +++ b/src/layouts/upload/inputPDF.js @@ -32,7 +32,7 @@ const PDFUploader = () => { const handleSubmit = async () => { if (selectedFiles.length > 0) { try { - const response = await uploadPdfs(selectedFiles); // Replace with your API call to upload PDFs + const response = await uploadPdfs(selectedFiles, imageScan); // Replace with your API call to upload PDFs console.log("PDF upload response:", response); setBackendResponse(response.message); } catch (error) {