diff --git a/src/Components/Document/DocEditPage.js b/src/Components/Document/DocEditPage.js index f27656d..6fe23a6 100644 --- a/src/Components/Document/DocEditPage.js +++ b/src/Components/Document/DocEditPage.js @@ -198,6 +198,7 @@ const DocEditPage = () => { if (docSnap.exists()) { const _case = docSnap.data(); _case.id = docSnap._key.path.segments[1]; + console.log("_case", _case); setFetchedCase(_case); } else { console.log("DB item does not exist"); diff --git a/src/Constants/Copy/docEditCopy.js b/src/Constants/Copy/docEditCopy.js index 5ab774f..ac52dee 100644 --- a/src/Constants/Copy/docEditCopy.js +++ b/src/Constants/Copy/docEditCopy.js @@ -6,7 +6,7 @@ export const docEditCopy = { servingParty, fetchedCase ) { - const position = fetchedCase.clientPosition; + const position = fetchedCase ? fetchedCase.clientPosition : <>; const docCopy = documentType && documentType === "interrogatories" ? "Interrogatories" @@ -59,15 +59,25 @@ export const docEditCopy = { export const outgoingComesNow = (state, fetchedCase) => { let copyString; - const position = fetchedCase?.clientPosition; - const parties = - fetchedCase?.clientPosition === "Plaintiff" - ? fetchedCase?.plaintiffParties - : fetchedCase?.defendantParties; - const adversary = - fetchedCase?.clientPosition === "Plaintiff" - ? fetchedCase?.defendantParties - : fetchedCase?.plaintiffParties; + const position = fetchedCase ? fetchedCase?.clientPosition : <>; + const parties = fetchedCase ? ( + fetchedCase?.clientPosition === "Plaintiff" ? ( + fetchedCase?.plaintiffParties + ) : ( + fetchedCase?.defendantParties + ) + ) : ( + <> + ); + const adversary = fetchedCase ? ( + fetchedCase?.clientPosition === "Plaintiff" ? ( + fetchedCase?.defendantParties + ) : ( + fetchedCase?.plaintiffParties + ) + ) : ( + <> + ); if (state === "ny") { copyString = `COMES NOW, ${position}, ${parties}, through counsel, and hereby propounds these Interrogatories and Requests for Production on ${adversary}, to be answered under oath, in writing, in accordance with NY CPLR 3120 - 3130.`;