attachment

This commit is contained in:
hamid zarghami
2026-07-12 12:13:31 +03:30
parent 7c2d6c465e
commit c11c972c7c
9 changed files with 96 additions and 25 deletions
@@ -2,6 +2,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/TaskService";
import {
CreateCheckListItemType,
CreateTaskAttachmentType,
CreateTaskRemarkType,
CreateTaskType,
UpdateCheckListItemType,
@@ -88,3 +89,15 @@ export const useUpdateCheckListItem = () => {
},
});
};
export const useCreateTaskAttachment = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (variables: CreateTaskAttachmentType) => api.createTaskAttachment(variables),
onSuccess: (_data, variables) => {
queryClient.invalidateQueries({ queryKey: ["task-detail", variables.taskId] });
queryClient.invalidateQueries({ queryKey: ["project"] });
},
});
};