Implement Space membership by group

* Add all users to default group
* Fixes and updates
This commit is contained in:
Philipinho
2024-03-20 01:26:03 +00:00
parent a821e37028
commit 51b9808382
22 changed files with 425 additions and 82 deletions

View File

@ -15,7 +15,6 @@ import { Page } from '../../page/entities/page.entity';
import { Comment } from '../../comment/entities/comment.entity';
import { Space } from '../../space/entities/space.entity';
import { SpaceUser } from '../../space/entities/space-user.entity';
import { Group } from '../../group/entities/group.entity';
@Entity('users')
@Unique(['email', 'workspaceId'])
@ -44,7 +43,9 @@ export class User {
@Column({ nullable: true })
workspaceId: string;
@ManyToOne(() => Workspace, (workspace) => workspace.users)
@ManyToOne(() => Workspace, (workspace) => workspace.users, {
onDelete: 'CASCADE',
})
workspace: Workspace;
@Column({ length: 100, nullable: true })
@ -68,9 +69,6 @@ export class User {
@UpdateDateColumn()
updatedAt: Date;
@OneToMany(() => Group, (group) => group.creator)
groups: Group[];
@OneToMany(() => Page, (page) => page.creator)
createdPages: Page[];