recall usebucket hook after delete and create contact.
This commit is contained in:
parent
1c8461e72a
commit
e03d1b4e99
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user