diff --git a/src/logic/login-user.ts b/src/logic/login-user.ts index 80026e1..6d36f64 100644 --- a/src/logic/login-user.ts +++ b/src/logic/login-user.ts @@ -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; + } }