mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 17:17:55 +00:00
Merge pull request #44 from SyncrowIOT/fix-some-issues
Refactor code to remove duplicate code and improve readability
This commit is contained in:
@@ -103,7 +103,6 @@ export class DeviceService {
|
||||
const devicesData = await Promise.all(
|
||||
devices.map(async (device) => {
|
||||
return {
|
||||
uuid: device.uuid,
|
||||
haveRoom: device.spaceDevice ? true : false,
|
||||
productUuid: device.productDevice.uuid,
|
||||
productType: device.productDevice.prodType,
|
||||
@@ -111,6 +110,7 @@ export class DeviceService {
|
||||
...(await this.getDeviceDetailsByDeviceIdTuya(
|
||||
device.deviceTuyaUuid,
|
||||
)),
|
||||
uuid: device.uuid,
|
||||
} as GetDeviceDetailsInterface;
|
||||
}),
|
||||
);
|
||||
@@ -149,7 +149,6 @@ export class DeviceService {
|
||||
const devicesData = await Promise.all(
|
||||
devices.map(async (device) => {
|
||||
return {
|
||||
uuid: device.uuid,
|
||||
haveRoom: device.spaceDevice ? true : false,
|
||||
productUuid: device.productDevice.uuid,
|
||||
productType: device.productDevice.prodType,
|
||||
@@ -157,6 +156,7 @@ export class DeviceService {
|
||||
...(await this.getDeviceDetailsByDeviceIdTuya(
|
||||
device.deviceTuyaUuid,
|
||||
)),
|
||||
uuid: device.uuid,
|
||||
} as GetDeviceDetailsInterface;
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user