mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
feat: computed fullname field in user model
This commit is contained in:
parent
987fafd440
commit
ae6798ce62
@ -6,6 +6,7 @@ import {
|
||||
beforeCreate,
|
||||
beforeSave,
|
||||
column,
|
||||
computed,
|
||||
HasOne,
|
||||
hasOne,
|
||||
ManyToMany,
|
||||
@ -27,6 +28,11 @@ export default class User extends BaseModel {
|
||||
@column()
|
||||
public last_name: string;
|
||||
|
||||
@computed()
|
||||
public get fullname() {
|
||||
return `${this.first_name} ${this.last_name}`;
|
||||
}
|
||||
|
||||
@column({ serializeAs: null })
|
||||
public login: string;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user