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

41 lines
698 B

import baseService from "./baseService"
const url = "/api/color_themes"
/**
* Gets the color themes
*
* @returns {Promise<Array>}
*/
async function getThemes() {
const { items } = await baseService.getCollection(url)
return items
}
/**
* Update or create a theme with the title
*
* @param {string|null} iri
* @param {string} title
* @param {Object} colors
* @returns {Promise<Object>}
*/
async function updateTheme({ iri = null, title, colors }) {
if (iri) {
return await baseService.put(iri, {
title,
variables: colors,
})
}
return await baseService.post(url, {
title,
variables: colors,
})
}
export default {
getThemes,
updateTheme,
}