import { request } from './request';
import { apiClient } from './axiosClient';

const ENDPOINT = '/api/category';

export const requestCreateCategory = async (data) => {
    const res = await request.post(`${ENDPOINT}/create`, data);
    return res.data;
};

export const requestUpdateCategory = async (id, data) => {
    const res = await request.put(`${ENDPOINT}/update/${id}`, data);
    return res.data;
};

export const requestDeleteCategory = async (id) => {
    const res = await request.delete(`${ENDPOINT}/delete/${id}`);
    return res.data;
};

export const requestGetAllCategory = async () => {
    const res = await request.get(`${ENDPOINT}/list`);
    return res.data;
};
