removed the validation for space model subspaces and allocations

This commit is contained in:
hannathkadher
2025-03-04 12:48:21 +04:00
parent 19c02da8ad
commit 1caecfe6d9
2 changed files with 1 additions and 15 deletions

View File

@ -12,7 +12,7 @@ export class LinkSpacesToModelDto {
})
@IsArray()
@ArrayNotEmpty()
@IsUUID()
@IsUUID('4', { each: true })
spaceUuids: string[];
@ApiProperty({

View File

@ -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({