add: paging in user and relation when get in user
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Roles } from 'src/configurable/entities/roles.entity';
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn, BeforeInsert,
|
||||
PrimaryGeneratedColumn, BeforeInsert, ManyToOne,
|
||||
} from 'typeorm';
|
||||
import { BaseModel } from '../../config/basemodel.entity';
|
||||
import { hashPassword } from '../../helper/hash_password';
|
||||
@@ -22,4 +23,24 @@ export class User extends BaseModel {
|
||||
|
||||
@Column({ default: true })
|
||||
isActive: boolean;
|
||||
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return User;
|
||||
},
|
||||
(user) => {
|
||||
return user.id;
|
||||
},
|
||||
)
|
||||
superior: User;
|
||||
|
||||
@ManyToOne(
|
||||
() => {
|
||||
return Roles;
|
||||
},
|
||||
(roles) => {
|
||||
return roles.id;
|
||||
},
|
||||
)
|
||||
roles: Roles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user