more
This commit is contained in:
@@ -77,17 +77,14 @@ const UploadModal = (props) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
|
let respGenVal;
|
||||||
|
if (radioValue === "complaint") {
|
||||||
|
respGenVal = 1;
|
||||||
|
} else {
|
||||||
|
respGenVal = 0;
|
||||||
|
}
|
||||||
const data = {
|
const data = {
|
||||||
ownerId: appUserId,
|
ownerId: appUserId,
|
||||||
createdAt: createdAt,
|
createdAt: createdAt,
|
||||||
@@ -99,14 +96,13 @@ const UploadModal = (props) => {
|
|||||||
parentCaseName: `${caption} v. ${captionTwo}`,
|
parentCaseName: `${caption} v. ${captionTwo}`,
|
||||||
parentCaseNumber: caseNumber,
|
parentCaseNumber: caseNumber,
|
||||||
parentCaseJurisdiction: jurisdiction,
|
parentCaseJurisdiction: jurisdiction,
|
||||||
responseGenerations: 0,
|
responseGenerations: respGenVal,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (radioValue === "complaint") {
|
if (radioValue === "complaint") {
|
||||||
docType = "interrogatories-out";
|
docType = "interrogatories-out";
|
||||||
data["docType"] = docType;
|
data["docType"] = docType;
|
||||||
updateUserAccountDocsGenerated(fbUserId);
|
updateUserAccountDocsGenerated(fbUserId);
|
||||||
updateRespGenerationCount(uuidName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user