learning
This commit is contained in:
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user