more
This commit is contained in:
@@ -11,6 +11,7 @@ import { collection, setDoc, updateDoc, doc } from "firebase/firestore";
|
||||
import { AppContext } from "../../Hooks/useContext/appContext.js";
|
||||
import { db } from "../../firebase";
|
||||
import { objectMap } from "../../Utils/Object";
|
||||
import { createCaseFields as fields } from "../../Constants/Fields/CreateCaseFields.js";
|
||||
import "../../styles/modals.scss";
|
||||
import {
|
||||
getFormDataDefaults,
|
||||
@@ -29,27 +30,6 @@ const CreateModal = ({ setShowModal, caseData }) => {
|
||||
const editCaseId = caseData?.id;
|
||||
const isEditing = typeof editCaseId !== "undefined";
|
||||
|
||||
const fields = {
|
||||
caption: { required: true, maxLength: 45 },
|
||||
captionTwo: { required: true, maxLength: 45 },
|
||||
caseNumber: { required: true, maxLength: 45 },
|
||||
judge: { required: true, maxLength: 45 },
|
||||
plaintiffParties: { required: true, maxLength: 45 },
|
||||
defendantParties: { required: true, maxLength: 45 },
|
||||
jurisdiction: { required: true, maxLength: 45 },
|
||||
billingCode: { required: true, maxLength: 45 },
|
||||
venue: { required: true, maxLength: 45 },
|
||||
caseType: { required: true, maxLength: 45 },
|
||||
trialDate: { required: true, maxLength: 45, type: "date" },
|
||||
filedDate: { required: true, maxLength: 45, type: "date" },
|
||||
contactFirstName: { required: true, maxLength: 45 },
|
||||
contactLastName: { required: true, maxLength: 45 },
|
||||
contactEmail: { required: true, maxLength: 45, type: "email" },
|
||||
leadAttorneys: { required: true, maxLength: 45 },
|
||||
lawFirm: { required: false, maxLength: 45 },
|
||||
clientPosition: { required: true, default: "Defendant" },
|
||||
};
|
||||
|
||||
const [isBusy, setIsBusy] = useState(false);
|
||||
const [data, setData] = useState(
|
||||
getFormDataDefaults(fields, isEditing ? caseData : undefined)
|
||||
|
||||
Reference in New Issue
Block a user