Issues_July_3W #262
@ -213,7 +213,7 @@ export const useUpdateEmployee = () =>
|
|||||||
|
|
||||||
export const useSuspendEmployee = ({ setIsDeleteModalOpen, setemployeeLodaing }) => {
|
export const useSuspendEmployee = ({ setIsDeleteModalOpen, setemployeeLodaing }) => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
const selectedProject = useSelector((store)=>store.localVariables.projectId)
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: (id) => {
|
mutationFn: (id) => {
|
||||||
setemployeeLodaing(true);
|
setemployeeLodaing(true);
|
||||||
@ -221,12 +221,12 @@ export const useSuspendEmployee = ({ setIsDeleteModalOpen, setemployeeLodaing })
|
|||||||
},
|
},
|
||||||
|
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
showToast("Employee deleted successfully.", "success");
|
|
||||||
|
|
||||||
// queryClient.invalidateQueries( ['allEmployee',false]);
|
// queryClient.invalidateQueries( ['allEmployee',false]);
|
||||||
queryClient.invalidateQueries( {queryKey: [ 'projectEmployees' ]} );
|
queryClient.invalidateQueries( {queryKey: [ 'projectEmployees' ]} );
|
||||||
queryClient.invalidateQueries( {queryKey:[ 'employeeListByProject' ,selectedProject]} );
|
queryClient.invalidateQueries( {queryKey:[ 'employeeListByProject' ,selectedProject]} );
|
||||||
|
showToast("Employee deleted successfully.", "success");
|
||||||
setIsDeleteModalOpen(false);
|
setIsDeleteModalOpen(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user