mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 15:37:55 +00:00
add client relation btw user and client
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Entity, Column, Unique } from 'typeorm';
|
||||
import { Entity, Column, Unique, OneToMany } from 'typeorm';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { ClientDto } from '../dtos';
|
||||
import { UserEntity } from '../../user/entities';
|
||||
|
||||
@Entity({ name: 'clients' })
|
||||
@Unique(['clientId'])
|
||||
@@ -39,4 +40,7 @@ export class ClientEntity extends AbstractEntity<ClientDto> {
|
||||
|
||||
@Column('simple-array')
|
||||
scopes: string[];
|
||||
|
||||
@OneToMany(() => UserEntity, (user) => user.client)
|
||||
users: UserEntity[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user