more
This commit is contained in:
@@ -137,7 +137,7 @@ function App() {
|
|||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
path="/docedit/:documentId/:caseId"
|
path="/docedit/:documentId/:caseId/:docType/:clientPosition"
|
||||||
element={
|
element={
|
||||||
<PrivateRoute>
|
<PrivateRoute>
|
||||||
<DocEditPage />
|
<DocEditPage />
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ const CaseDetailsPage = () => {
|
|||||||
const data = doc.data();
|
const data = doc.data();
|
||||||
if (data.docType != undefined) {
|
if (data.docType != undefined) {
|
||||||
const caseId = data.parentCaseId;
|
const caseId = data.parentCaseId;
|
||||||
navigate(`/docedit/${docId}/${caseId}`);
|
const docType = data.docType;
|
||||||
|
const clientPosition = data.clientPosition;
|
||||||
|
navigate(`/docedit/${docId}/${caseId}/${docType}/${clientPosition}`);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(getDocument, 30000, docId, caseId);
|
setTimeout(getDocument, 30000, docId, caseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,10 @@ import "../../styles/docedit-page.scss";
|
|||||||
|
|
||||||
const DocEditPage = (props) => {
|
const DocEditPage = (props) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { documentId, caseId } = useParams();
|
const { documentId, caseId, docType, clientPosition } = useParams();
|
||||||
|
console.log("fucking docType", docType);
|
||||||
const [document, setDocument] = useState(null);
|
const [document, setDocument] = useState(null);
|
||||||
const [docType, setDocType] = useState(null);
|
const [_docType, setDocType] = useState(docType);
|
||||||
const [fetchedCase, setFetchedCase] = useState(null);
|
const [fetchedCase, setFetchedCase] = useState(null);
|
||||||
const [parsedRogs, setParsedRogs] = useState([]);
|
const [parsedRogs, setParsedRogs] = useState([]);
|
||||||
const [responses, setResponses] = useState([]);
|
const [responses, setResponses] = useState([]);
|
||||||
@@ -184,7 +185,55 @@ const DocEditPage = (props) => {
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function generateRespIncominIrregDiscReq(docId, clientPosition) {
|
||||||
|
console.log(
|
||||||
|
"generateRespIncominIrregDiscReq fieed and heres docType, doctype",
|
||||||
|
docType,
|
||||||
|
docType
|
||||||
|
);
|
||||||
|
const isRequests = true;
|
||||||
|
try {
|
||||||
|
fetch(
|
||||||
|
`${apiUrl}/v1/generate-disc-responses-irreg/${documentId}/${docType}/${isRequests}`,
|
||||||
|
{
|
||||||
|
method: "GET",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(function (response) {
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then((data) => {
|
||||||
|
console.log("data in generateRespIncominIrregDiscReq", data);
|
||||||
|
const respArray = data[0].responses;
|
||||||
|
const result = respArray?.map((item, index) => {
|
||||||
|
let obj = {};
|
||||||
|
obj["showInputEle"] = false;
|
||||||
|
obj["resp"] = item.text;
|
||||||
|
obj["index"] = index;
|
||||||
|
return obj;
|
||||||
|
});
|
||||||
|
setResponses(result);
|
||||||
|
setIsLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err) => console.log(err));
|
||||||
|
} catch (err) {
|
||||||
|
console.log("generateRespIncomingDiscReq resp err", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
console.log("docType in first useEffect", docType);
|
||||||
|
if (!docType || docType != "combined-numbered") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
generateRespIncominIrregDiscReq(documentId, clientPosition);
|
||||||
|
}, [documentId, docType, docType]);
|
||||||
|
/*
|
||||||
|
useEffect(() => {
|
||||||
|
console.log("docType in second useEffect", docType);
|
||||||
|
if (!docType || docType == "combined-numbered") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
getCompletions(documentId, docType)
|
getCompletions(documentId, docType)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
const respond = data[0].responses.length > 2 ? data[0].responses : null;
|
const respond = data[0].responses.length > 2 ? data[0].responses : null;
|
||||||
@@ -195,7 +244,8 @@ const DocEditPage = (props) => {
|
|||||||
setResponses(resp);
|
setResponses(resp);
|
||||||
})
|
})
|
||||||
.catch((err) => console.log(err));
|
.catch((err) => console.log(err));
|
||||||
}, [documentId, docType]);
|
}, [documentId, docType, docType]);
|
||||||
|
*/
|
||||||
async function getParsedRogs(docId, docType) {
|
async function getParsedRogs(docId, docType) {
|
||||||
if (!docId || !docType) {
|
if (!docId || !docType) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ const UploadModal = (props) => {
|
|||||||
parentCaseNumber: caseNumber,
|
parentCaseNumber: caseNumber,
|
||||||
parentCaseJurisdiction: jurisdiction,
|
parentCaseJurisdiction: jurisdiction,
|
||||||
responseGenerations: respGenVal,
|
responseGenerations: respGenVal,
|
||||||
|
clientPosition: clientPosition,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (radioValue === "complaint") {
|
if (radioValue === "complaint") {
|
||||||
|
|||||||
Reference in New Issue
Block a user