Skip to content

Commit

Permalink
pdf extractor mini updated
Browse files Browse the repository at this point in the history
  • Loading branch information
NadunSanjeevana committed Sep 12, 2023
1 parent 36df94a commit b899032
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api/sendPdf.js
Original file line number Diff line number Diff line change
@@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/upload/inputPDF.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b899032

Please sign in to comment.