mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 09:54:55 +00:00
Merge pull request #146 from SyncrowIOT/add-room-to-device-details
finshed add subspace to devices details
This commit is contained in:
@ -82,11 +82,15 @@ export class DeviceService {
|
||||
deviceUuid: string,
|
||||
withProductDevice: boolean = true,
|
||||
) {
|
||||
return await this.deviceRepository.findOne({
|
||||
where: {
|
||||
uuid: deviceUuid,
|
||||
},
|
||||
...(withProductDevice && { relations: ['productDevice'] }),
|
||||
const relations = ['subspace'];
|
||||
|
||||
if (withProductDevice) {
|
||||
relations.push('productDevice');
|
||||
}
|
||||
|
||||
return this.deviceRepository.findOne({
|
||||
where: { uuid: deviceUuid },
|
||||
relations,
|
||||
});
|
||||
}
|
||||
|
||||
@ -568,6 +572,7 @@ export class DeviceService {
|
||||
productType: deviceDetails.productDevice.prodType,
|
||||
permissionType: userDevicePermission,
|
||||
macAddress: macAddress.mac,
|
||||
subspace: deviceDetails.subspace ? deviceDetails.subspace : {},
|
||||
};
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
|
||||
Reference in New Issue
Block a user