mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 07:34:54 +00:00
added validation for space model
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user