This commit is contained in:
hamid zarghami
2025-11-01 11:55:02 +03:30
parent edadb01702
commit 5acfad3e2e
12 changed files with 947 additions and 2 deletions
@@ -0,0 +1,25 @@
import axios from "../../../config/axios";
import {
CreateCategoryLearningType,
CreateLearningType,
} from "../types/LearningTypes";
export const getCategory = async () => {
const { data } = await axios.get(`/learnings/category`);
return data;
};
export const createCategory = async (params: CreateCategoryLearningType) => {
const { data } = await axios.post(`/learnings/category`, params);
return data;
};
export const CreateLearning = async (params: CreateLearningType) => {
const { data } = await axios.post(`/learnings`, params);
return data;
};
export const getLearnings = async (page: number) => {
const { data } = await axios.get(`/learnings?page=${page}`);
return data;
};