Replace space privacy with visibility

* Make creatorId nullable
This commit is contained in:
Philipinho
2024-03-21 20:31:32 +00:00
parent 186c4f5f5c
commit 639842182c
6 changed files with 57 additions and 8 deletions

View File

@ -13,7 +13,7 @@ import { User } from '../../user/entities/user.entity';
import { Workspace } from '../../workspace/entities/workspace.entity';
import { SpaceUser } from './space-user.entity';
import { Page } from '../../page/entities/page.entity';
import { SpacePrivacy, SpaceRole } from '../../../helpers/types/permission';
import { SpaceVisibility, SpaceRole } from '../../../helpers/types/permission';
import { SpaceGroup } from './space-group.entity';
@Entity('spaces')
@ -34,13 +34,13 @@ export class Space {
@Column({ length: 255, nullable: true })
icon: string;
@Column({ length: 100, default: SpacePrivacy.OPEN })
privacy: string;
@Column({ length: 100, default: SpaceVisibility.OPEN })
visibility: string;
@Column({ length: 100, default: SpaceRole.WRITER })
defaultRole: string;
@Column()
@Column({ nullable: true })
creatorId: string;
@ManyToOne(() => User)

View File

@ -52,9 +52,9 @@ export class Workspace {
@Column({ nullable: true, type: 'uuid' })
creatorId: string;
//@ManyToOne(() => User, (user) => user.workspaces)
// @JoinColumn({ name: 'creatorId' })
// creator: User;
@OneToOne(() => User)
@JoinColumn({ name: 'creatorId' })
creator: User;
@Column({ nullable: true })
defaultSpaceId: string;