added validation for space model

This commit is contained in:
hannathkadher
2025-03-11 22:11:25 +04:00
parent b6fa37b1a3
commit 1403a670e3

View File

@ -45,14 +45,15 @@ export class ValidationService {
await this.communityService.validateProject(projectUuid);
const spaces = await this.spaceRepository.find({
where: { uuid: In(spacesUuids), disabled: false },
relations: ['devices', 'subspaces', 'productAllocations'],
relations: ['devices', 'subspaces', 'productAllocations', 'spaceModel'],
});
const hasInvalidSpaces = spaces.some(
(space) =>
space.devices.length > 0 ||
space.subspaces.length > 0 ||
space.productAllocations.length > 0,
space.productAllocations.length > 0 ||
space.spaceModel,
);
if (hasInvalidSpaces) {