React Query Integration for Server State Sync in Clinet #245

Merged
admin merged 60 commits from react-query into main 2025-07-11 11:32:19 +00:00
Showing only changes of commit f7f9c4044b - Show all commits

View File

@ -173,12 +173,13 @@ export const useCreateTask = ( {onSuccessCallback, onErrorCallback} = {} ) =>
{
const queryClient = useQueryClient();
return useMutation({
mutationFn: async (payload) => {
mutationFn: async ({payload,workAreaId}) => {
return await TasksRepository.assignTask(payload);
},
onSuccess: ( _, variables ) =>
{
queryClient.invalidateQueries({queryKey:["taskList"]});
queryClient.invalidateQueries( {queryKey: [ "taskList" ]} );
queryClient.invalidateQueries( {queryKey: [ "WorkItems", variables?.workAreaId ]} );
showToast( "Task Assigned Successfully.", "success" );
if (onSuccessCallback) onSuccessCallback(variables);
},