refactor: clean up comments and streamline payload handling in user detail form
This commit is contained in:
@@ -267,9 +267,6 @@ const ListContact = memo(function ListContact(props) {
|
||||
}
|
||||
}
|
||||
|
||||
// Backend doesn't support is_active filter or order parameter
|
||||
// Contact hanya supports: criteria, name, code, limit, page
|
||||
|
||||
const queryParams = new URLSearchParams();
|
||||
Object.entries(searchParams).forEach(([key, value]) => {
|
||||
if (value !== '' && value !== null && value !== undefined) {
|
||||
@@ -309,11 +306,10 @@ const ListContact = memo(function ListContact(props) {
|
||||
// Listen for saved contact data
|
||||
useEffect(() => {
|
||||
if (props.lastSavedContact) {
|
||||
fetchContacts(); // Refetch all contacts when data is saved
|
||||
fetchContacts();
|
||||
}
|
||||
}, [props.lastSavedContact]);
|
||||
|
||||
// Get contacts (already filtered by backend)
|
||||
const getFilteredContacts = () => {
|
||||
return filteredContacts;
|
||||
};
|
||||
@@ -326,7 +322,7 @@ const ListContact = memo(function ListContact(props) {
|
||||
const showAddModal = () => {
|
||||
props.setSelectedData(null);
|
||||
props.setActionMode('add');
|
||||
// Pass the current active tab to determine contact type
|
||||
|
||||
props.setContactType?.(activeTab);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user