diff --git a/src/Components/Case/CaseTypePage.js b/src/Components/Case/CaseTypePage.js index 58b1a09..ffd3441 100644 --- a/src/Components/Case/CaseTypePage.js +++ b/src/Components/Case/CaseTypePage.js @@ -94,12 +94,16 @@ const CaseTypePage = () => { clientPositionValid; if (!leadAttorneyValid) { + setLeadAttorneyError("Field cannot be left blank"); } if (!contactEmailValid) { + setContactEmailError("Field cannot be left blank"); } if (!caseTypeValid) { + setCaseTypeError("Field cannot be left blank"); } if (!clientPositionValid) { + setClientPositionError("You must make a selection"); } return allValid; @@ -123,7 +127,7 @@ const CaseTypePage = () => { try { await updateDoc(doc(db, "cases", caseId), dataValues); setIsBusy(false); - navigate(`/casedetail/${caseId}`); + navigate(`/casedetails/${caseId}`); } catch (err) { console.log("Error updating case:", err); setIsBusy(false); @@ -152,7 +156,11 @@ const CaseTypePage = () => { onChange={(e) => setLeadAttorney(e.target.value)} >
- {leadAttorneyError ?
{leadAttorneyError}
: <>} + {leadAttorneyError ? ( +
{leadAttorneyError}
+ ) : ( + <> + )}
@@ -186,7 +194,11 @@ const CaseTypePage = () => { value={contactEmail} onChange={(e) => setContactEmail(e.target.value)} > - {contactEmailError ?
{contactEmailError}
: <>} + {contactEmailError ? ( +
{contactEmailError}
+ ) : ( + <> + )}
@@ -208,6 +220,11 @@ const CaseTypePage = () => { typeaheadRef.current.clear(); }} /> + {caseTypeError ? ( +
{caseTypeError}
+ ) : ( + <> + )}
{selectedCaseTags.map((tag, i) => (
@@ -216,7 +233,7 @@ const CaseTypePage = () => { className="tag-ex-box" onClick={() => handleTagClick(tag)} > -
x
+
x
{tag}
@@ -233,9 +250,15 @@ const CaseTypePage = () => { onClick={(e) => handleSetRadioValue(e, "clientPosition")} />
+ {clientPositionError ? ( +
{clientPositionError}
+ ) : ( + <> + )} -
+ +