Files
negareh-admin/src/pages/learning/service/LearningService.ts
T
hamid zarghami 5acfad3e2e learning
2025-11-01 11:55:02 +03:30

26 lines
705 B
TypeScript

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;
};