[+] Create constructor for it

This commit is contained in:
Hykilpikonna
2019-12-02 14:17:04 -05:00
parent c6ca171101
commit 991580473d
+19
View File
@@ -16,4 +16,23 @@ export default class LoginUser
birthday: string;
avatarUrl: string;
token: string;
constructor(json: any)
{
this.id = json.id;
this.schoolPersonPk = json.schoolPersonPk;
this.username = json.username;
this.lastLogin = new Date(json.lastLogin);
this.firstLogin = new Date(json.firstLogin);
this.firstName = json.firstName;
this.lastName = json.lastName;
this.nickname = json.nickname;
this.graduationYear = json.graduationYear;
this.groups = json.groups;
this.emails = json.emails.split('|');
this.classes = json.classes.split('|');
this.birthday = json.birthday;
this.avatarUrl = json.avatarUrl;
this.token = json.token;
}
}