26 lines
705 B
TypeScript
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;
|
|
};
|