diff --git a/src/space-model/dtos/link-space-model.dto.ts b/src/space-model/dtos/link-space-model.dto.ts index 07f7674..b22ba06 100644 --- a/src/space-model/dtos/link-space-model.dto.ts +++ b/src/space-model/dtos/link-space-model.dto.ts @@ -12,7 +12,7 @@ export class LinkSpacesToModelDto { }) @IsArray() @ArrayNotEmpty() - @IsUUID() + @IsUUID('4', { each: true }) spaceUuids: string[]; @ApiProperty({ diff --git a/src/space-model/services/space-model.service.ts b/src/space-model/services/space-model.service.ts index a0e1532..c25fcbd 100644 --- a/src/space-model/services/space-model.service.ts +++ b/src/space-model/services/space-model.service.ts @@ -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({