selectProject was missing to defined in - useSuspendEmployee - therefor getting this - selected Project is not defined but actually employee is suspended properly, but show just extrap error msg
This commit is contained in:
parent
6bf33b27a0
commit
b9c240261c
@ -213,7 +213,7 @@ export const useUpdateEmployee = () =>
|
||||
|
||||
export const useSuspendEmployee = ({ setIsDeleteModalOpen, setemployeeLodaing }) => {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const selectedProject = useSelector((store)=>store.localVariables.projectId)
|
||||
return useMutation({
|
||||
mutationFn: (id) => {
|
||||
setemployeeLodaing(true);
|
||||
@ -221,12 +221,12 @@ export const useSuspendEmployee = ({ setIsDeleteModalOpen, setemployeeLodaing })
|
||||
},
|
||||
|
||||
onSuccess: () => {
|
||||
showToast("Employee deleted successfully.", "success");
|
||||
|
||||
|
||||
// queryClient.invalidateQueries( ['allEmployee',false]);
|
||||
queryClient.invalidateQueries( {queryKey: [ 'projectEmployees' ]} );
|
||||
queryClient.invalidateQueries( {queryKey:[ 'employeeListByProject' ,selectedProject]} );
|
||||
|
||||
showToast("Employee deleted successfully.", "success");
|
||||
setIsDeleteModalOpen(false);
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user