more
This commit is contained in:
@@ -54,11 +54,17 @@ const CaseDetailsPage = () => {
|
||||
const docType = data.docType;
|
||||
const clientPosition = data.clientPosition;
|
||||
if (docType != "combined-numbered") {
|
||||
console.log(
|
||||
"docType != combined-numbered~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||
);
|
||||
const responseGenerations = 1;
|
||||
navigate(
|
||||
`/docedit/${docId}/${caseId}/${docType}/${clientPosition}/${responseGenerations}`
|
||||
);
|
||||
} else if (docType == "combined-numbered") {
|
||||
console.log(
|
||||
"docType is equal to combined-numbered~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
||||
);
|
||||
const responseGenerations = 0;
|
||||
navigate(
|
||||
`/docedit/${docId}/${caseId}/${docType}/${clientPosition}/${responseGenerations}`
|
||||
@@ -75,11 +81,8 @@ const CaseDetailsPage = () => {
|
||||
|
||||
function handleIncomingDiscoveryRequest(docId, isComplaint, clientPosition) {
|
||||
//ONLY TRIGGER FROM THIS SIDE (next page) IF IT IS COMBINED NUMBERED
|
||||
setTimeout(generateRespIncomingDiscReq, 20000, docId, clientPosition);
|
||||
const res = getDocument(docId);
|
||||
if (res === "combined-numbered") {
|
||||
const documentId = docId;
|
||||
}
|
||||
setTimeout(generateRespIncomingDiscReq, 10000, docId, clientPosition);
|
||||
setTimeout(getDocument, 50000, docId);
|
||||
}
|
||||
// isComplaint = true - NEVER CHANGE THIS/THESE ARGS
|
||||
async function generateOutgoingDiscReq(docId, clientPosition) {
|
||||
|
||||
@@ -167,19 +167,26 @@ const DocEditPage = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
async function getParsedRogs(docId, docType) {
|
||||
if (!docId || !docType) {
|
||||
async function getParsedRequests(documentId, docType) {
|
||||
if (!documentId || !docType) {
|
||||
return;
|
||||
}
|
||||
console.log("getparsedrogs fired");
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${apiUrl}/v1/get-parsed-requests/${docId}/${docType}`,
|
||||
`${apiUrl}/v1/get-parsed-requests/${documentId}/${docType}`,
|
||||
{
|
||||
method: "GET",
|
||||
}
|
||||
);
|
||||
const resp = await response.json();
|
||||
return resp;
|
||||
const res = await response.json();
|
||||
|
||||
const req = res[0].requests;
|
||||
if (req.length > 1) {
|
||||
setParsedRogs(req);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Error occured:", err);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -205,23 +212,16 @@ const DocEditPage = (props) => {
|
||||
}, [caseId, documentId]);
|
||||
|
||||
useEffect(() => {
|
||||
getParsedRogs(documentId, docType)
|
||||
.then((data) => {
|
||||
data && console.log("data in useEffect for getParsedRogs", data);
|
||||
const respond = data[0].requests?.length > 2 ? data[0].requests : null;
|
||||
const resp = respond?.map((item, index) => {
|
||||
// NEVER CHANGE THIS:
|
||||
return { showInputEle: false, text: item?.text, index: index };
|
||||
});
|
||||
setParsedRogs(resp);
|
||||
})
|
||||
.catch((err) => console.log(err));
|
||||
getParsedRequests(documentId, docType);
|
||||
}, [documentId, docType]);
|
||||
|
||||
async function getCompletions(docId, docType) {
|
||||
if (!docId || !docType) {
|
||||
return;
|
||||
}
|
||||
console.log(
|
||||
"--_~_~_~_~_~_~_~_~__--- - - - f -- - - - -- -- -getCompletions in decedit"
|
||||
);
|
||||
const response = await fetch(
|
||||
`${apiUrl}/v1/get-completions/${docId}/${docType}`,
|
||||
{
|
||||
@@ -296,9 +296,7 @@ const DocEditPage = (props) => {
|
||||
setIsLoading(true);
|
||||
getCompletions(documentId, docType)
|
||||
.then((data) => {
|
||||
const respond =
|
||||
data[0].responses.length > 2 ? data[0].responses : null;
|
||||
const resp = respond?.map((item, index) => {
|
||||
const resp = data[0].responses.map((item, index) => {
|
||||
// NEVER CHANGE THIS:
|
||||
return { showInputEle: false, resp: item?.text, index: index };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user