[O] Obtain comments

This commit is contained in:
Hykilpikonna
2020-05-08 20:00:54 -04:00
parent 4b0bf16916
commit f5c63aa958
@@ -114,7 +114,23 @@
openDetails(course: CourseInfo)
{
this.detailsCourse = this.detailsCourse == course ? null as any as CourseInfo : course;
let c = this.detailsCourse = this.detailsCourse == course ? null as any as CourseInfo : course;
// Load comments
App.http.post('/course-info/rating/get', {condition: 'course-comments', value: c.id_ci}).then(result =>
{
if (result.success)
{
this.detailsComments = result.data.map((r:any) => new CourseInfoRating(r));
}
else
{
this.$message.error(`Rating data for ${c.name} / ${c.teacher} failed to load.`)
console.log(result.data);
}
})
// TODO: Finish comment section
}
closeDetails()