From b9f0987bb0c20691087f214bfabc6c649849e59c Mon Sep 17 00:00:00 2001 From: hannathkadher Date: Mon, 10 Mar 2025 15:20:15 +0400 Subject: [PATCH] added validation for product allocations --- src/space/services/space-validation.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/space/services/space-validation.service.ts b/src/space/services/space-validation.service.ts index 88c39c3..5ac6f01 100644 --- a/src/space/services/space-validation.service.ts +++ b/src/space/services/space-validation.service.ts @@ -45,11 +45,14 @@ export class ValidationService { await this.communityService.validateProject(projectUuid); const spaces = await this.spaceRepository.find({ where: { uuid: In(spacesUuids), disabled: false }, - relations: ['devices', 'subspaces'], + relations: ['devices', 'subspaces', 'productAllocations'], }); const hasInvalidSpaces = spaces.some( - (space) => space.devices.length > 0 || space.subspaces.length > 0, + (space) => + space.devices.length > 0 || + space.subspaces.length > 0 || + space.productAllocations.length > 0, ); if (hasInvalidSpaces) {