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