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.
23 lines
672 B
23 lines
672 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,
|
|
}
|
|
}
|
|
|