diff --git a/libs/common/src/modules/space/entities/subspace/subspace-product.entity.ts b/libs/common/src/modules/space/entities/subspace/subspace-product.entity.ts index 87ed807..ea98520 100644 --- a/libs/common/src/modules/space/entities/subspace/subspace-product.entity.ts +++ b/libs/common/src/modules/space/entities/subspace/subspace-product.entity.ts @@ -3,10 +3,7 @@ import { Column, Entity, ManyToOne, OneToMany } from 'typeorm'; import { SubspaceEntity } from './subspace.entity'; import { AbstractEntity } from '@app/common/modules/abstract/entities/abstract.entity'; import { SubspaceProductItemEntity } from './subspace-product-item.entity'; -import { - SubspaceProductItemModelEntity, - SubspaceProductModelEntity, -} from '@app/common/modules/space-model'; +import { SubspaceProductModelEntity } from '@app/common/modules/space-model'; import { SpaceProductModelDto } from '../../dtos'; @Entity({ name: 'subspace-product' }) diff --git a/libs/common/src/modules/user/entities/user.entity.ts b/libs/common/src/modules/user/entities/user.entity.ts index 04697fa..097b154 100644 --- a/libs/common/src/modules/user/entities/user.entity.ts +++ b/libs/common/src/modules/user/entities/user.entity.ts @@ -117,7 +117,7 @@ export class UserEntity extends AbstractEntity { public visitorPasswords: VisitorPasswordEntity[]; @ManyToOne(() => RoleTypeEntity, (roleType) => roleType.users, { - nullable: true, + nullable: false, }) public roleType: RoleTypeEntity; @OneToOne(() => InviteUserEntity, (inviteUser) => inviteUser.user, { diff --git a/src/project/handler/create-orphan-space.handler.service.ts b/src/project/handler/create-orphan-space.handler.service.ts index 8935afe..662b93e 100644 --- a/src/project/handler/create-orphan-space.handler.service.ts +++ b/src/project/handler/create-orphan-space.handler.service.ts @@ -23,13 +23,15 @@ export class CreateOrphanSpaceHandler async execute(command: CreateOrphanSpaceCommand): Promise { try { const { project } = command; + const orphanCommunityName = `${ORPHAN_COMMUNITY_NAME}-${project.name}`; + let orphanCommunity = await this.communityRepository.findOne({ - where: { name: ORPHAN_COMMUNITY_NAME, project }, + where: { name: orphanCommunityName, project }, }); if (!orphanCommunity) { orphanCommunity = this.communityRepository.create({ - name: ORPHAN_COMMUNITY_NAME, + name: orphanCommunityName, description: ORPHAN_COMMUNITY_DESCRIPTION, project, });