This commit is contained in:
Kenneth Jannette
2024-03-07 20:24:59 -06:00
parent a344cfbfd4
commit c713033e71
3 changed files with 15 additions and 5 deletions

View File

@@ -63,8 +63,9 @@ const RequestEditPage = () => {
? process.env.REACT_APP_API_DEV
: process.env.REACT_APP_API_PROD;
console.log("documentId", documentId);
useEffect(() => {
if (!appUserId || !docId) {
if (!appUserId || !documentId) {
setDocument(null);
return;
}
@@ -74,7 +75,7 @@ const RequestEditPage = () => {
} catch (err) {
console.log("Error:", err);
}
}, [appUserId, docId, caseId]);
}, [appUserId, documentId, caseId]);
useEffect(() => {
if (!documentId || !documentType) {
@@ -92,6 +93,7 @@ const RequestEditPage = () => {
})
.catch((err) => console.log(err));
}, [documentId]);
async function getCase(parentCaseId) {
try {
const docRef = doc(db, "cases", `${parentCaseId}`);
@@ -108,8 +110,10 @@ const RequestEditPage = () => {
}
}
async function getOutgoingRequests(docId) {
async function getOutgoingRequests(documentId) {
console.log("get out going requests called times:");
const docType = String(documentType);
const docId = String(documentId);
const response = await fetch(
`${apiUrl}/v1/get-outgoing-requests/${docId}/${docType}`,
{