From 0694497f8d5cfb37fc0c7fc8f7bf0c94b608fadb Mon Sep 17 00:00:00 2001 From: Rafiafrzl Date: Wed, 3 Dec 2025 10:49:16 +0700 Subject: [PATCH] feat: remove contact_type from DetailContact component --- src/pages/contact/component/DetailContact.jsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/pages/contact/component/DetailContact.jsx b/src/pages/contact/component/DetailContact.jsx index ea73910..ed4ff19 100644 --- a/src/pages/contact/component/DetailContact.jsx +++ b/src/pages/contact/component/DetailContact.jsx @@ -14,7 +14,6 @@ const DetailContact = memo(function DetailContact(props) { name: '', phone: '', is_active: true, - contact_type: '', }; const [formData, setFormData] = useState(defaultData); @@ -37,13 +36,7 @@ const DetailContact = memo(function DetailContact(props) { } }; - const handleContactTypeChange = (value) => { - setFormData((prev) => ({ - ...prev, - contact_type: value, - })); - }; - + const handleStatusToggle = (checked) => { setFormData({ ...formData, @@ -58,7 +51,6 @@ const DetailContact = memo(function DetailContact(props) { const validationRules = [ { field: 'name', label: 'Contact Name', required: true }, { field: 'phone', label: 'Phone', required: true }, - { field: 'contact_type', label: 'Contact Type', required: true }, ]; if ( @@ -97,7 +89,6 @@ const DetailContact = memo(function DetailContact(props) { contact_name: formData.name, contact_phone: formData.phone.replace(/[\s\-\(\)]/g, ''), // Clean phone number is_active: formData.is_active, - contact_type: formData.contact_type, }; let response; @@ -145,18 +136,16 @@ const DetailContact = memo(function DetailContact(props) { phone: props.selectedData.contact_phone || props.selectedData.phone, is_active: props.selectedData.is_active || props.selectedData.status === 'active', - contact_type: props.selectedData.contact_type || props.contactType || '', }); } else if (props.actionMode === 'add') { setFormData({ name: '', phone: '', is_active: true, - contact_type: props.contactType === 'all' ? '' : props.contactType || '', }); } } - }, [props.showModal, props.actionMode, props.selectedData, props.contactType]); + }, [props.showModal, props.actionMode, props.selectedData]); return (