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:
commit
7f45dbab2a
@ -23,7 +23,7 @@ import {DireProvider, useDir} from "../../Context/DireContext";
|
|||||||
|
|
||||||
const Directory = ({IsPage=true,prefernceContacts}) =>
|
const Directory = ({IsPage=true,prefernceContacts}) =>
|
||||||
{
|
{
|
||||||
const[projectPrefernce,setPerfence] = useState(null)
|
const [ projectPrefernce, setPerfence ] = useState( null )
|
||||||
const[IsActive,setIsActive] = useState(true)
|
const[IsActive,setIsActive] = useState(true)
|
||||||
const [isOpenModal, setIsOpenModal] = useState(false);
|
const [isOpenModal, setIsOpenModal] = useState(false);
|
||||||
const [isOpenModalNote, setIsOpenModalNote] = useState(false);
|
const [isOpenModalNote, setIsOpenModalNote] = useState(false);
|
||||||
@ -48,7 +48,7 @@ const Directory = ({IsPage=true,prefernceContacts}) =>
|
|||||||
const { contacts, loading , refetch} = useDirectory(IsActive,projectPrefernce);
|
const { contacts, loading , refetch} = useDirectory(IsActive,projectPrefernce);
|
||||||
const { contactCategory, loading: contactCategoryLoading } =
|
const { contactCategory, loading: contactCategoryLoading } =
|
||||||
useContactCategory();
|
useContactCategory();
|
||||||
const {buckets} = useBuckets();
|
const {buckets,refetch:refetchBucket} = useBuckets();
|
||||||
|
|
||||||
const submitContact = async (data) => {
|
const submitContact = async (data) => {
|
||||||
try {
|
try {
|
||||||
@ -73,7 +73,8 @@ const Directory = ({IsPage=true,prefernceContacts}) =>
|
|||||||
|
|
||||||
// cacheData("Contacts", {data:updatedContacts,isActive:IsActive});
|
// cacheData("Contacts", {data:updatedContacts,isActive:IsActive});
|
||||||
// setContactList(updatedContacts);
|
// setContactList(updatedContacts);
|
||||||
refetch(IsActive,prefernceContacts)
|
refetch( IsActive, prefernceContacts )
|
||||||
|
refetchBucket()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const msg =
|
const msg =
|
||||||
error.response?.data?.message ||
|
error.response?.data?.message ||
|
||||||
@ -105,7 +106,8 @@ const handleDeleteContact = async (overrideId = null) => {
|
|||||||
|
|
||||||
showToast(`Contact ${IsActive ? "Deleted":"Restored"} successfully`, "success");
|
showToast(`Contact ${IsActive ? "Deleted":"Restored"} successfully`, "success");
|
||||||
|
|
||||||
setDeleteContact(null);
|
setDeleteContact( null );
|
||||||
|
refetchBucket()
|
||||||
setDirActions({ action: false, id: null });
|
setDirActions({ action: false, id: null });
|
||||||
setDeleting(false);
|
setDeleting(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user