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