diff --git a/src/device/services/device.service.ts b/src/device/services/device.service.ts index 2cd5639..45cdafd 100644 --- a/src/device/services/device.service.ts +++ b/src/device/services/device.service.ts @@ -1019,6 +1019,7 @@ export class DeviceService { uuid: space.uuid, spaceName: space.spaceName, })), + productUuid: device.productDevice.uuid, productType: device.productDevice.prodType, community: { diff --git a/src/space/services/subspace/subspace.service.ts b/src/space/services/subspace/subspace.service.ts index 78f9445..acd2fd3 100644 --- a/src/space/services/subspace/subspace.service.ts +++ b/src/space/services/subspace/subspace.service.ts @@ -58,7 +58,7 @@ export class SubSpaceService { return await queryRunner.manager.save(subspaces); } catch (error) { throw new HttpException( - 'An unexpected error occurred while creating subspaces.', + `An unexpected error occurred while creating subspaces. ${error}`, HttpStatus.INTERNAL_SERVER_ERROR, ); } @@ -98,9 +98,8 @@ export class SubSpaceService { otherTags?: CreateTagDto[], ): Promise { try { - await this.validateName( - addSubspaceDtos.map((dto) => dto.subspaceName), - space, + this.checkForDuplicateNames( + addSubspaceDtos.map(({ subspaceName }) => subspaceName), ); const subspaceData = addSubspaceDtos.map((dto) => ({