diff --git a/public/js/apps/Studentenverwaltung.js b/public/js/apps/Studentenverwaltung.js index 4a8607a42..e6a93c5c5 100644 --- a/public/js/apps/Studentenverwaltung.js +++ b/public/js/apps/Studentenverwaltung.js @@ -20,6 +20,8 @@ import fhcapifactory from "./api/fhcapifactory.js"; import PvConfig from "../../../index.ci.php/public/js/components/primevue/config/config.esm.min.js"; +import FhcAlert from "../plugin/FhcAlert.js"; + Vue.$fhcapi = fhcapifactory; const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router; @@ -39,5 +41,6 @@ const app = Vue.createApp(); app .use(router) .use(PvConfig) + .use(FhcAlert) .mount('#main'); diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Details.js b/public/js/components/Stv/Studentenverwaltung/Details/Details.js index 22f1b012f..50554f388 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Details.js @@ -123,16 +123,17 @@ export default { this.gebDatumIsValid = true; // TODO(chris): phrase - this.addToast('Gespeichert', '', 'success'); + this.$fhcAlert.alertSuccess('Gespeichert'); + //this.addToast('Gespeichert', '', 'success'); this.original = {...this.data}; this.changed = {}; } }) - .catch(err => { + .catch(this.$fhcAlert.handleSystemError/*err => { // TODO(chris): phrase this.addToast('Error', err?.response?.data || err?.message, 'error'); - }) + }*/); }, resetErrors() { Array.from(this.$refs.form.getElementsByClassName('is-valid')).forEach(el => el.classList.remove('is-valid')); @@ -156,14 +157,14 @@ export default { feedback.classList.add('invalid-feedback'); feedback.innerHTML = msg; input.after(feedback); - }, + /*}, addToast(header, msg, severity) { this.$refs.responseToast.add({ severity: severity, summary: header, detail: msg, life: 3000 - }) + })*/ } }, created() {