Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
affa1b0d46
|
@ -1,13 +1,12 @@
|
|||
import { Roles } from 'src/configurable/entities/roles.entity';
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
Entity,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { BaseModel } from '../../config/basemodel.entity';
|
||||
import { hashPassword } from '../../helper/hash_password';
|
||||
import { Partner } from './partner.entity';
|
||||
import { UserDetail } from './user_detail.entity';
|
||||
import { COA } from '../../transaction/entities/coa.entity';
|
||||
|
@ -59,7 +58,8 @@ export class User extends BaseModel {
|
|||
)
|
||||
partner: Partner;
|
||||
|
||||
user_detail: UserDetail;
|
||||
@OneToOne(() => UserDetail, (userDetail) => userDetail.user)
|
||||
userDetail: UserDetail;
|
||||
|
||||
coa: COA;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
OneToOne,
|
||||
ManyToOne,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { accountType } from '../../helper/enum-list';
|
||||
import { User } from './user.entity';
|
||||
|
||||
@Entity()
|
||||
|
@ -20,7 +18,7 @@ export class UserDetail {
|
|||
@Column()
|
||||
phone_number: string;
|
||||
|
||||
@OneToOne(() => User)
|
||||
@OneToOne(() => User, (user) => user.userDetail)
|
||||
@JoinColumn()
|
||||
user: User;
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ export class UsersService {
|
|||
where: {
|
||||
id: id,
|
||||
},
|
||||
relations: ['roles', 'superior'],
|
||||
relations: ['roles', 'superior', 'userDetail'],
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue
Block a user