Re-enabled submit and reset logic, removed console log

This commit is contained in:
Pramod Mahajan 2025-05-18 17:13:15 +05:30
parent 61ce554e05
commit b6a0fb54ac

View File

@ -78,10 +78,10 @@ const ManageDirectory = ({ submitContact, onCLosed }) => {
useEffect(() => {
if (emailFields.length === 0) {
appendEmail({ label: "Work", emailAddress: "" }); // valid object
appendEmail({ label: "Work", emailAddress: "" });
}
if (phoneFields.length === 0) {
appendPhone({ label: "Office", phoneNumber: "" }); // valid object
appendPhone({ label: "Office", phoneNumber: "" });
}
}, [emailFields.length, phoneFields.length]);
@ -133,10 +133,8 @@ useEffect(() => {
),
};
// Submit cleaned data
console.log(cleaned);
// setSubmitting(true);
// submitContact(data, reset, setSubmitting);
setSubmitting(true);
submitContact(cleaned, reset, setSubmitting);
};
const handleClosed = () => {