fix: user detail relations

This commit is contained in:
caturbgs
2021-12-16 15:34:19 +07:00
parent e43ec5129d
commit fabc663021
3 changed files with 9 additions and 11 deletions

View File

@@ -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;
}