From 8e54749e2e74301d5177895ac7a7495def9c81dd Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 27 Apr 2020 02:19:33 -0400 Subject: [PATCH] [+] Create alternative constructor for posting --- src/logic/course-info.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/logic/course-info.ts b/src/logic/course-info.ts index bf5acdf..40db338 100644 --- a/src/logic/course-info.ts +++ b/src/logic/course-info.ts @@ -111,4 +111,14 @@ export class CourseInfoRating this.ratings = json.ratings; this.comment = json.comment; } + + /** + * Create new for posting to the server + * @param id_ci + */ + public static createNew(id_ci: number) + { + return new CourseInfoRating({id_ci: id_ci, id_user: -1, userFullName: null, + anonymous: false, ratings: [0,0,0,0,0], comment: ''}) + } }