This commit is contained in:
Kenneth Jannette
2024-03-07 22:34:39 -06:00
parent ef0ec80c08
commit 870da158a6

View File

@@ -119,49 +119,19 @@ const UploadModal = (props) => {
} }
async function uploadFile(file) { async function uploadFile(file) {
console.log(
"uploadFile radioValue, clientPosition",
radioValue,
clientPosition
);
if (!clientPosition) { if (!clientPosition) {
return; return;
} }
const now = new Date();
try { try {
if (radioValue.toLowerCase() === "complaint") { if (radioValue.toLowerCase() === "complaint") {
if (clientPosition === "Plaintiff") { const response = await fetch(`${apiUrl}/v1/upload-convert-complaint`, {
console.log( method: "POST",
"111111111--------------------------sending POST to:", body: file,
`${apiUrl}/v1/gen-disc-request-pl`, });
"----------------------------------------at time:", const res = response;
`${now}` return res;
);
const response = await fetch(`${apiUrl}/v1/gen-disc-request-pl`, {
method: "POST",
body: file,
});
const res = response;
return res;
} else if (clientPosition === "Defendant") {
console.log(
"222222222------------------------------sending POST to:",
`${apiUrl}/v1/gen-disc-request-df`,
"----------------------------------------at time:",
`${now}`
);
const response = await fetch(`${apiUrl}/v1/gen-disc-request-df`, {
method: "POST",
body: file,
});
const res = response;
return res;
}
} else { } else {
console.log(
"3333333333333 -------------------------sending POST to:",
`${apiUrl}/v1/parse-new-req-doc`
);
const response = await fetch(`${apiUrl}/v1/parse-new-req-doc`, { const response = await fetch(`${apiUrl}/v1/parse-new-req-doc`, {
method: "POST", method: "POST",
body: file, body: file,
@@ -220,7 +190,7 @@ const UploadModal = (props) => {
const response = await processFile(); const response = await processFile();
saveToDb(response.uuidName); saveToDb(response.uuidName);
handleSuccess(docType, response.uuidName); handleSuccess(docType, response.uuidName, radioValue);
return; return;
} catch (err) { } catch (err) {
console.log("err", err); console.log("err", err);