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/composables/upload.js

24 lines
670 B

import {useI18n} from "vue-i18n";
import {useNotification} from "./notification";
// This is the migration from assets/vue/mixins/UploadMixin.js to composables
// some components still use UploadMixin with options API, this should be use
// when migrating from options API to composition API
export const useUpload = () => {
const {t} = useI18n();
const notification = useNotification()
const onCreated = (item) => {
notification.showSuccessNotification(t('{resource} created', {'resource': item['resourceNode'].title}))
}
const onError = (message) => {
notification.showErrorNotification(message)
}
return {
onCreated,
onError,
}
}