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.
25 lines
529 B
25 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
|
|
},
|
|
}
|
|
|