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.
43 lines
990 B
43 lines
990 B
<template>
|
|
<div class="course-list">
|
|
{{ status }}
|
|
<SessionCard :sessions="sessions"></SessionCard>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import SessionCard from './SessionCard';
|
|
import ListMixin from '../../../mixins/ListMixin';
|
|
import { ENTRYPOINT } from '../../../config/entrypoint';
|
|
import axios from "axios";
|
|
|
|
export default {
|
|
name: 'SessionList',
|
|
servicePrefix: 'Course',
|
|
mixins: [ListMixin],
|
|
components: {
|
|
SessionCard
|
|
},
|
|
data() {
|
|
return {
|
|
status: null,
|
|
sessions:null
|
|
};
|
|
},
|
|
created: function () {
|
|
this.load();
|
|
},
|
|
methods: {
|
|
load: function() {
|
|
this.status = 'Loading';
|
|
let user = this.$store.getters['security/getUser'];
|
|
axios.get(ENTRYPOINT + 'users/' + user.id + '/session_course_subscriptions.json').then(response => {
|
|
this.status = '';
|
|
this.sessions = response.data;
|
|
}).catch(function (error) {
|
|
this.status = error;
|
|
});
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|