more
This commit is contained in:
@@ -74,6 +74,29 @@ const RequestEditPage = () => {
|
|||||||
}
|
}
|
||||||
}, [appUserId, docId, caseId]);
|
}, [appUserId, docId, caseId]);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GET parsed requests.
|
||||||
|
* GET completions if already generated
|
||||||
|
*/
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!documentId || !documentType) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getOutgoingRequests(documentId)
|
||||||
|
.then((data) => {
|
||||||
|
console.log("data in getOutgoingRequests"), data;
|
||||||
|
/*
|
||||||
|
const resp = data[0].responses.map((item, index) => {
|
||||||
|
// NEVER CHANGE THIS:
|
||||||
|
return { showInputEle: false, resp: item.text, index: index };
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
setResponses(resp);
|
||||||
|
})
|
||||||
|
.catch((err) => console.log(err));
|
||||||
|
}, [documentId]);
|
||||||
|
|
||||||
async function getCase(parentCaseId) {
|
async function getCase(parentCaseId) {
|
||||||
try {
|
try {
|
||||||
const docRef = doc(db, "cases", `${parentCaseId}`);
|
const docRef = doc(db, "cases", `${parentCaseId}`);
|
||||||
@@ -90,6 +113,18 @@ const RequestEditPage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getOutgoingRequests(docId) {
|
||||||
|
const docType = String(documentType);
|
||||||
|
const response = await fetch(
|
||||||
|
`${apiUrl}/v1/get-outgoing-requests/${docId}/${docType}`,
|
||||||
|
{
|
||||||
|
method: "GET",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const req = await response.json();
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
const onScrollClick = () => {
|
const onScrollClick = () => {
|
||||||
const bottom = window.document.scrollingElement.scrollHeight;
|
const bottom = window.document.scrollingElement.scrollHeight;
|
||||||
const place = window.scrollY;
|
const place = window.scrollY;
|
||||||
|
|||||||
Reference in New Issue
Block a user