update task phase
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-07-12 12:29:52 +03:30
parent fd545231d3
commit 95177b529e
10 changed files with 205 additions and 33 deletions
@@ -1,6 +1,7 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/TaskService";
import {
ChangeTaskPhaseType,
CreateCheckListItemType,
CreateTaskAttachmentType,
CreateTaskRemarkType,
@@ -40,6 +41,20 @@ export const useUpdateTask = () => {
});
};
export const useChangeTaskPhase = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({ id, params }: { id: string; params: ChangeTaskPhaseType; projectId: string }) =>
api.changeTaskPhase(id, params),
onSuccess: (_data, variables) => {
queryClient.invalidateQueries({ queryKey: ["task-detail", variables.id] });
queryClient.invalidateQueries({ queryKey: ["project", variables.projectId] });
queryClient.invalidateQueries({ queryKey: ["project"] });
},
});
};
export const useDeleteTask = () => {
const queryClient = useQueryClient();