more
This commit is contained in:
@@ -119,49 +119,19 @@ const UploadModal = (props) => {
|
||||
}
|
||||
|
||||
async function uploadFile(file) {
|
||||
console.log(
|
||||
"uploadFile radioValue, clientPosition",
|
||||
radioValue,
|
||||
clientPosition
|
||||
);
|
||||
if (!clientPosition) {
|
||||
return;
|
||||
}
|
||||
const now = new Date();
|
||||
|
||||
try {
|
||||
if (radioValue.toLowerCase() === "complaint") {
|
||||
if (clientPosition === "Plaintiff") {
|
||||
console.log(
|
||||
"111111111--------------------------sending POST to:",
|
||||
`${apiUrl}/v1/gen-disc-request-pl`,
|
||||
"----------------------------------------at time:",
|
||||
`${now}`
|
||||
);
|
||||
const response = await fetch(`${apiUrl}/v1/gen-disc-request-pl`, {
|
||||
const response = await fetch(`${apiUrl}/v1/upload-convert-complaint`, {
|
||||
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 {
|
||||
console.log(
|
||||
"3333333333333 -------------------------sending POST to:",
|
||||
`${apiUrl}/v1/parse-new-req-doc`
|
||||
);
|
||||
const response = await fetch(`${apiUrl}/v1/parse-new-req-doc`, {
|
||||
method: "POST",
|
||||
body: file,
|
||||
@@ -220,7 +190,7 @@ const UploadModal = (props) => {
|
||||
const response = await processFile();
|
||||
|
||||
saveToDb(response.uuidName);
|
||||
handleSuccess(docType, response.uuidName);
|
||||
handleSuccess(docType, response.uuidName, radioValue);
|
||||
return;
|
||||
} catch (err) {
|
||||
console.log("err", err);
|
||||
|
||||
Reference in New Issue
Block a user