[O] Make AnalyzedRating a class
This commit is contained in:
@@ -125,9 +125,15 @@ export class CourseInfoRating
|
||||
}
|
||||
}
|
||||
|
||||
export interface AnalyzedRating
|
||||
export class AnalyzedRating
|
||||
{
|
||||
ratingCounts: number[][]
|
||||
ratingSums: number[]
|
||||
totalCount: number
|
||||
constructor(json: any)
|
||||
{
|
||||
this.ratingCounts = json.ratingCounts;
|
||||
this.ratingSums = json.ratingSums;
|
||||
this.totalCount = json.totalCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
if (result.success)
|
||||
{
|
||||
// Assign rating
|
||||
c.rating = result.data as AnalyzedRating;
|
||||
c.rating = new AnalyzedRating(result.data);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user