more
This commit is contained in:
@@ -98,6 +98,11 @@ const CaseDetailsPage = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleConfirmDocType = (docType) => {
|
||||||
|
console.log("docType", docType);
|
||||||
|
setShowConfirmModal(true);
|
||||||
|
};
|
||||||
|
|
||||||
const handleCancelConfirm = () => {
|
const handleCancelConfirm = () => {
|
||||||
setShowConfirmModal(false);
|
setShowConfirmModal(false);
|
||||||
};
|
};
|
||||||
@@ -108,14 +113,7 @@ const CaseDetailsPage = () => {
|
|||||||
navigate(`/signup/${isUpgrade}/${currentPlan}`);
|
navigate(`/signup/${isUpgrade}/${currentPlan}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
async function updateUserAccountDocsGenerated() {
|
|
||||||
await updateDoc(doc(db, "users", fbUserId), {
|
|
||||||
docsGenerated: increment(1),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSuccess = (docType, docId) => {
|
const handleSuccess = (docType, docId) => {
|
||||||
updateUserAccountDocsGenerated();
|
|
||||||
setShowUploadModal(false);
|
setShowUploadModal(false);
|
||||||
if (docType === "interrogatories-out") {
|
if (docType === "interrogatories-out") {
|
||||||
setTimeout(handleNavEdit, 40000, docId, caseId);
|
setTimeout(handleNavEdit, 40000, docId, caseId);
|
||||||
@@ -187,6 +185,8 @@ const CaseDetailsPage = () => {
|
|||||||
setIsLoading={setIsLoading}
|
setIsLoading={setIsLoading}
|
||||||
handleSuccess={handleSuccess}
|
handleSuccess={handleSuccess}
|
||||||
caseData={subCase}
|
caseData={subCase}
|
||||||
|
handleConfirmDocType={handleConfirmDocType}
|
||||||
|
fbUserId={fbUserId}
|
||||||
/>
|
/>
|
||||||
) : null
|
) : null
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -458,12 +458,9 @@ const DocEditPage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function updateRespGenerationCount(docId) {
|
async function updateRespGenerationCount(docId) {
|
||||||
console.log("updaeeResponseGenerationCount fired");
|
|
||||||
if (!docId) {
|
if (!docId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("updaeeResponseGenerationCount past if block");
|
|
||||||
await updateDoc(doc(db, "documents", docId), {
|
await updateDoc(doc(db, "documents", docId), {
|
||||||
responseGenerations: increment(1),
|
responseGenerations: increment(1),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,13 @@ import Row from "react-bootstrap/Row";
|
|||||||
import Col from "react-bootstrap/Col";
|
import Col from "react-bootstrap/Col";
|
||||||
import Radiogroup from "../../pageElements/Radiogroup";
|
import Radiogroup from "../../pageElements/Radiogroup";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { collection, setDoc, doc } from "firebase/firestore";
|
import {
|
||||||
|
collection,
|
||||||
|
setDoc,
|
||||||
|
doc,
|
||||||
|
updateDoc,
|
||||||
|
increment,
|
||||||
|
} from "firebase/firestore";
|
||||||
import { db } from "../../firebase";
|
import { db } from "../../firebase";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import TextInput from "../../pageElements/TextInput";
|
import TextInput from "../../pageElements/TextInput";
|
||||||
@@ -30,6 +36,8 @@ const UploadModal = (props) => {
|
|||||||
handleSuccess,
|
handleSuccess,
|
||||||
setIsLoading,
|
setIsLoading,
|
||||||
clientPositiion,
|
clientPositiion,
|
||||||
|
handleConfirmDocType,
|
||||||
|
fbUserId,
|
||||||
} = props;
|
} = props;
|
||||||
const { caseId, caseNumber, jurisdiction, caption, captionTwo } = caseData;
|
const { caseId, caseNumber, jurisdiction, caption, captionTwo } = caseData;
|
||||||
const [docTitle, setDocTitle] = useState("");
|
const [docTitle, setDocTitle] = useState("");
|
||||||
@@ -65,6 +73,21 @@ const UploadModal = (props) => {
|
|||||||
setRadioValue(e.value);
|
setRadioValue(e.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async function updateUserAccountDocsGenerated(fbUserId) {
|
||||||
|
await updateDoc(doc(db, "users", fbUserId), {
|
||||||
|
docsGenerated: increment(1),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateRespGenerationCount(docId) {
|
||||||
|
if (!docId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await updateDoc(doc(db, "documents", docId), {
|
||||||
|
responseGenerations: increment(1),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function saveToDb(uuidName) {
|
async function saveToDb(uuidName) {
|
||||||
const createdAt = new Date();
|
const createdAt = new Date();
|
||||||
const data = {
|
const data = {
|
||||||
@@ -84,6 +107,8 @@ const UploadModal = (props) => {
|
|||||||
if (radioValue === "complaint") {
|
if (radioValue === "complaint") {
|
||||||
docType = "interrogatories-out";
|
docType = "interrogatories-out";
|
||||||
data["docType"] = docType;
|
data["docType"] = docType;
|
||||||
|
updateUserAccountDocsGenerated(fbUserId);
|
||||||
|
updateRespGenerationCount(uuidName);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user