Merge pull request 'pramod_Bug#422 : Incorrect Contact Count in Manage Bucket Screen' (#169) from pramod_Bug#422 into Feature_Directory

Reviewed-on: #169
This commit is contained in:
Vikas Nale 2025-06-02 07:54:23 +00:00
commit 7f45dbab2a

View File

@ -48,7 +48,7 @@ const Directory = ({IsPage=true,prefernceContacts}) =>
const { contacts, loading , refetch} = useDirectory(IsActive,projectPrefernce);
const { contactCategory, loading: contactCategoryLoading } =
useContactCategory();
const {buckets} = useBuckets();
const {buckets,refetch:refetchBucket} = useBuckets();
const submitContact = async (data) => {
try {
@ -74,6 +74,7 @@ const Directory = ({IsPage=true,prefernceContacts}) =>
// cacheData("Contacts", {data:updatedContacts,isActive:IsActive});
// setContactList(updatedContacts);
refetch( IsActive, prefernceContacts )
refetchBucket()
} catch (error) {
const msg =
error.response?.data?.message ||
@ -106,6 +107,7 @@ const handleDeleteContact = async (overrideId = null) => {
showToast(`Contact ${IsActive ? "Deleted":"Restored"} successfully`, "success");
setDeleteContact( null );
refetchBucket()
setDirActions({ action: false, id: null });
setDeleting(false);
} catch (error) {