mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 07:57:55 +00:00
Add project relationship to InviteUserEntity and invitedUsers to ProjectEntity
This commit is contained in:
@@ -4,6 +4,7 @@ import { ProjectDto } from '../dtos';
|
||||
import { CommunityEntity } from '../../community/entities';
|
||||
import { SpaceModelEntity } from '../../space-model';
|
||||
import { UserEntity } from '../../user/entities';
|
||||
import { InviteUserEntity } from '../../Invite-user/entities';
|
||||
|
||||
@Entity({ name: 'project' })
|
||||
@Unique(['name'])
|
||||
@@ -32,6 +33,9 @@ export class ProjectEntity extends AbstractEntity<ProjectDto> {
|
||||
@OneToMany(() => UserEntity, (user) => user.project)
|
||||
public users: UserEntity[];
|
||||
|
||||
@OneToMany(() => InviteUserEntity, (inviteUser) => inviteUser.project)
|
||||
public invitedUsers: InviteUserEntity[];
|
||||
|
||||
constructor(partial: Partial<ProjectEntity>) {
|
||||
super();
|
||||
Object.assign(this, partial);
|
||||
|
||||
Reference in New Issue
Block a user