category learning

This commit is contained in:
hamid zarghami
2025-02-13 09:16:26 +03:30
parent 278aabf56e
commit 9b45a9be65
11 changed files with 263 additions and 5 deletions
@@ -0,0 +1,17 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/LearningService";
import { CreateCategoryLearningType } from "../types/LearningTypes";
export const useGetCategory = () => {
return useQuery({
queryKey: ["learning-category"],
queryFn: api.getCategory,
});
};
export const useCreateCategory = () => {
return useMutation({
mutationFn: (variables: CreateCategoryLearningType) =>
api.createCategory(variables),
});
};