learning
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/LearningService";
|
||||
import { CreateCategoryLearningType } from "../types/LearningTypes";
|
||||
import {
|
||||
CreateCategoryLearningType,
|
||||
CreateLearningType,
|
||||
} from "../types/LearningTypes";
|
||||
|
||||
export const useGetCategory = () => {
|
||||
return useQuery({
|
||||
@@ -15,3 +18,17 @@ export const useCreateCategory = () => {
|
||||
api.createCategory(variables),
|
||||
});
|
||||
};
|
||||
|
||||
export const useCreateLearning = () => {
|
||||
return useMutation({
|
||||
mutationFn: (variables: CreateLearningType) =>
|
||||
api.CreateLearning(variables),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetLearning = () => {
|
||||
return useQuery({
|
||||
queryKey: ["learnings"],
|
||||
queryFn: api.getLearnings,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user