create project

This commit is contained in:
hamid zarghami
2026-07-09 11:42:41 +03:30
parent 21a99d9ec1
commit b0737ea6ad
6 changed files with 245 additions and 23 deletions
@@ -0,0 +1,16 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/ProjectService";
import { CreateProjectType } from "../types/ProjectTypes";
export const useCreateProject = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (variables: CreateProjectType) => api.createProject(variables),
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ["projects"],
});
},
});
};