diff --git a/src/Components/Modals/UploadModal.js b/src/Components/Modals/UploadModal.js index 34f12b9..92cb99d 100644 --- a/src/Components/Modals/UploadModal.js +++ b/src/Components/Modals/UploadModal.js @@ -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) { const createdAt = new Date(); + let respGenVal; + if (radioValue === "complaint") { + respGenVal = 1; + } else { + respGenVal = 0; + } const data = { ownerId: appUserId, createdAt: createdAt, @@ -99,14 +96,13 @@ const UploadModal = (props) => { parentCaseName: `${caption} v. ${captionTwo}`, parentCaseNumber: caseNumber, parentCaseJurisdiction: jurisdiction, - responseGenerations: 0, + responseGenerations: respGenVal, }; if (radioValue === "complaint") { docType = "interrogatories-out"; data["docType"] = docType; updateUserAccountDocsGenerated(fbUserId); - updateRespGenerationCount(uuidName); } try {