negyedik gyakorlat + megoldasok

This commit is contained in:
magdo
2026-03-04 20:02:39 +01:00
parent afc3777ac9
commit 388aa908de
217 changed files with 19791 additions and 0 deletions
@@ -0,0 +1,20 @@
export class User {
constructor(data) {
this.id = data.id;
this.email = data.email;
this.username = data.username;
this.password = data.password;
this.role = data.role;
this.createdAt = data.createdAt;
this.updatedAt = data.updatedAt;
}
isAdmin() {
return this.role === 'ADMIN';
}
toJSON() {
const { password, ...userWithoutPassword } = this;
return userWithoutPassword;
}
}