mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 18:56:22 +00:00
fixing propagation
This commit is contained in:
@ -19,6 +19,11 @@ import { ValidateSpacesDto } from '../dtos/validation.space.dto';
|
||||
import { ProjectParam } from '../dtos';
|
||||
import { SuccessResponseDto } from '@app/common/dto/success.response.dto';
|
||||
import { In } from 'typeorm';
|
||||
import {
|
||||
ORPHAN_COMMUNITY_NAME,
|
||||
ORPHAN_SPACE_NAME,
|
||||
} from '@app/common/constants/orphan-constant';
|
||||
import { ProjectEntity } from '@app/common/modules/project/entities';
|
||||
|
||||
@Injectable()
|
||||
export class ValidationService {
|
||||
@ -286,4 +291,24 @@ export class ValidationService {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async getOrphanSpace(project: ProjectEntity): Promise<SpaceEntity> {
|
||||
const orphanSpace = await this.spaceRepository.findOne({
|
||||
where: {
|
||||
community: {
|
||||
name: `${ORPHAN_COMMUNITY_NAME}-${project.name}`,
|
||||
},
|
||||
spaceName: ORPHAN_SPACE_NAME,
|
||||
},
|
||||
});
|
||||
|
||||
if (!orphanSpace) {
|
||||
throw new HttpException(
|
||||
`Orphan space not found in community ${project.name}`,
|
||||
HttpStatus.NOT_FOUND,
|
||||
);
|
||||
}
|
||||
|
||||
return orphanSpace;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user