mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 09:24:54 +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,
|
deviceUuid: string,
|
||||||
withProductDevice: boolean = true,
|
withProductDevice: boolean = true,
|
||||||
) {
|
) {
|
||||||
return await this.deviceRepository.findOne({
|
const relations = ['subspace'];
|
||||||
where: {
|
|
||||||
uuid: deviceUuid,
|
if (withProductDevice) {
|
||||||
},
|
relations.push('productDevice');
|
||||||
...(withProductDevice && { relations: ['productDevice'] }),
|
}
|
||||||
|
|
||||||
|
return this.deviceRepository.findOne({
|
||||||
|
where: { uuid: deviceUuid },
|
||||||
|
relations,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,6 +572,7 @@ export class DeviceService {
|
|||||||
productType: deviceDetails.productDevice.prodType,
|
productType: deviceDetails.productDevice.prodType,
|
||||||
permissionType: userDevicePermission,
|
permissionType: userDevicePermission,
|
||||||
macAddress: macAddress.mac,
|
macAddress: macAddress.mac,
|
||||||
|
subspace: deviceDetails.subspace ? deviceDetails.subspace : {},
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new HttpException(
|
throw new HttpException(
|
||||||
|
|||||||
Reference in New Issue
Block a user