attachment
This commit is contained in:
@@ -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"] });
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user