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,
|
beforeCreate,
|
||||||
beforeSave,
|
beforeSave,
|
||||||
column,
|
column,
|
||||||
|
computed,
|
||||||
HasOne,
|
HasOne,
|
||||||
hasOne,
|
hasOne,
|
||||||
ManyToMany,
|
ManyToMany,
|
||||||
@ -27,6 +28,11 @@ export default class User extends BaseModel {
|
|||||||
@column()
|
@column()
|
||||||
public last_name: string;
|
public last_name: string;
|
||||||
|
|
||||||
|
@computed()
|
||||||
|
public get fullname() {
|
||||||
|
return `${this.first_name} ${this.last_name}`;
|
||||||
|
}
|
||||||
|
|
||||||
@column({ serializeAs: null })
|
@column({ serializeAs: null })
|
||||||
public login: string;
|
public login: string;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user