mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
removed the validation for space model subspaces and allocations
This commit is contained in:
@ -12,7 +12,7 @@ export class LinkSpacesToModelDto {
|
||||
})
|
||||
@IsArray()
|
||||
@ArrayNotEmpty()
|
||||
@IsUUID()
|
||||
@IsUUID('4', { each: true })
|
||||
spaceUuids: string[];
|
||||
|
||||
@ApiProperty({
|
||||
|
@ -337,13 +337,6 @@ export class SpaceModelService {
|
||||
);
|
||||
}
|
||||
|
||||
if (!spaceModel.productAllocations.length) {
|
||||
throw new HttpException(
|
||||
`Space Model ${params.spaceModelUuid} has no product allocations`,
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
const spaces = await this.spaceRepository.find({
|
||||
where: { uuid: In(dto.spaceUuids), disabled: false },
|
||||
relations: [
|
||||
@ -410,13 +403,6 @@ export class SpaceModelService {
|
||||
);
|
||||
await this.spaceProductAllocationRepository.save(spaceProductAllocations);
|
||||
|
||||
if (!spaceModel.subspaceModels.length) {
|
||||
throw new HttpException(
|
||||
`Space Model ${spaceModel.uuid} has no subspaces`,
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
spaceModel.subspaceModels.map(async (subspaceModel) => {
|
||||
const subspace = this.subspaceRepository.create({
|
||||
|
Reference in New Issue
Block a user