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/views/user/sessions/List.vue

46 lines
1019 B

<template>
<div class="grid">
{{ status }}
<SessionCardList :sessions="sessions"/>
</div>
</template>
<script>
import SessionCardList from './SessionCardList.vue';
import { ENTRYPOINT } from '../../../config/entrypoint';
import axios from "axios";
export default {
name: 'SessionList',
components: {
SessionCardList
},
data() {
return {
status: '',
sessions: []
};
},
created: function () {
this.load();
},
methods: {
load: function() {
this.status = 'Loading';
let user = this.$store.getters['security/getUser'];
if (user) {
axios.get(ENTRYPOINT + 'users/' + user.id + '/sessions_rel_users.json').then(response => {
this.status = '';
if (Array.isArray(response.data)) {
this.sessions = response.data;
}
}).catch(function (error) {
this.status = error;
});
} else {
this.status = '';
}
}
}
};
</script>