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/usergroupService.js

26 lines
529 B

import axios from "axios"
export default {
/**
* @param {string} searchTerm
* @returns {Promise<Object>} { totalItems, items }
*/
search: async (searchTerm) => {
const response = {}
try {
const { data } = await axios.get("/api/usergroups/search", {
params: { search: searchTerm },
})
response.totalItems = data["hydra:totalItems"]
response.items = data["hydra:member"]
} catch {
response.totalItems = 0
response.items = []
}
return response
},
}