Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/assets/vue/services/gradebookService.js

25 lines
696 B

import axios from "axios"
const API_BASE = "/gradebook"
export default {
/**
* Fetches gradebook categories for a specific course and session.
* @param {number} courseId The course ID.
* @param {number|null} sessionId The session ID (optional).
* @returns {Promise<Array>} The list of gradebook categories.
*/
async getCategories(courseId, sessionId = null) {
const params = { courseId }
if (sessionId) params.sessionId = sessionId
try {
const response = await axios.get(`${API_BASE}/categories`, { params })
return response.data
} catch (error) {
console.error("Error fetching gradebook categories:", error)
throw error
}
},
}