added project name to community name

This commit is contained in:
hannathkadher
2024-12-19 11:57:06 +04:00
parent f4741caa06
commit 66364811f6
2 changed files with 5 additions and 6 deletions
@@ -23,13 +23,15 @@ export class CreateOrphanSpaceHandler
async execute(command: CreateOrphanSpaceCommand): Promise<void> {
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,
});