import axiosInstance from '../../../../utils/axiosInstance';

const fetchMaterials = async (topicId, levelName) => {
    try {
        const response = await axiosInstance.get(`/level/topic/${topicId}`);
        const filteredData = response.data.data.levels.filter(item => item.NAME_LEVEL === levelName);
        return filteredData;
    } catch (error) {
        return [];
    }
};

export default {
    fetchMaterials,
};
