export class User {
- id: string;
+ id: number;
username: string;
role: string;
- createdDate: Date;
+ createdAt: Date;
- constructor(hash: { id: string, username: string, role: string, createdDate: Date }) {
+ constructor(hash: { id: number, username: string, role: string, createdAt?: Date }) {
this.id = hash.id;
this.username = hash.username;
this.role = hash.role;
- this.createdDate = hash.createdDate;
+
+ if (hash.createdAt) {
+ this.createdAt = hash.createdAt;
+ }
}
isAdmin() {