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 15967ce2fc
commit b082aa370b

View File

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