restructuring controller

This commit is contained in:
Simon Gschnell
2023-12-05 10:39:39 +01:00
parent 71fda916a3
commit 087bf229af
9 changed files with 1511 additions and 90 deletions
+55
View File
@@ -0,0 +1,55 @@
//import ProfilView from "../../components/Cis/Profil/Profil.js";
import StudentProfil from "../../components/Cis/Profil/StudentProfil.js";
import MitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterProfil.js";
import ViewStudentProfil from "../../components/Cis/Profil/StudentViewProfil.js";
import ViewMitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterViewProfil.js";
import fhcapifactory from "../api/fhcapifactory.js";
Vue.$fhcapi = fhcapifactory;
const app = Vue.createApp({
components: {
StudentProfil,
MitarbeiterProfil,
ViewStudentProfil,
ViewMitarbeiterProfil,
},
data() {
return {
view:null,
}
},
methods: {
},
created(){
let path = location.pathname;
console.log(path);
console.log(path.lastIndexOf('/'));
let uid = path.substring(path.lastIndexOf('/')).replace("/","");
console.log("i am passing this uid: ", uid);
const payload = {
...(uid != "Profil" ? {uid} : {})
};
Vue.$fhcapi.UserData.getView(payload).then((res)=>{
//this.view = res.data.view;
//this.data = res.data.data;
console.log(res.data);
});
},
template:`
<div>
<p>test element</p>
<!--<StudentProfil></StudentProfil>-->
<component :is="view"></component>
</div>`
});
app.mount("#content");
-19
View File
@@ -1,19 +0,0 @@
import Profil from "../../components/Cis/Profil/Profil.js";
const app = Vue.createApp({
components: {
Profil,
},
data() {
return {
}
},
methods: {
},
});
app.mount("#content");
+8 -2
View File
@@ -7,6 +7,12 @@ export default {
+ `cis.php/Cis/Profil/isMitarbeiterOrStudent/${uid}`;
return axios.get(url);
},
getView: function(payload) {
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root
+ `cis.php/Cis/Profil/getView`;
return axios.post(url,payload);
},
sperre_foto_function: function(value) {
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root
@@ -21,9 +27,9 @@ export default {
return axios.get(url);
},
mitarbeiterProfil: function(uid) {
mitarbeiterProfil: function() {
const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+
`/Cis/Profil/mitarbeiterProfil/${uid}`;
`/Cis/Profil/mitarbeiterProfil/`;
return axios.get(url);
},