Vue.component('profil-card', {
template: `
exit_to_app
Logout
{{ auth.name }}
{{ major }}
`,
data: function () {
return {
auth: auth,
abo: 7,
saved: 3,
isCardModalActive: false,
};
},
computed: {
major: function() {
// e.g. ST@B-ME;ST@EFI;
var majorID = auth.type.split(';')[0].split('@')[1];
//console.info(majorID);
//console.info(majorList);
var majorName = 'Studiengang Unbekannt';
majorList.forEach(function(major) {
if (major.id == majorID) {
majorName = major.name;
}
});
return majorName;
},
},
methods: {
logout: function() {
clearAuthState();
$.ajax({ url: "api/logout", method: "POST" });
router.push('/profil');
},
}
});