mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 02:15:21 +00:00
Refactor getDevicesInstructionStatus method for improved readability
This commit is contained in:
@ -381,12 +381,18 @@ export class DeviceService {
|
|||||||
}
|
}
|
||||||
async getDevicesInstructionStatus(deviceId: string) {
|
async getDevicesInstructionStatus(deviceId: string) {
|
||||||
try {
|
try {
|
||||||
const response = await this.getDevicesInstructionStatusTuya(deviceId);
|
const deviceStatus = await this.getDevicesInstructionStatusTuya(deviceId);
|
||||||
|
const productId: string = await this.getProductIdByDeviceId(deviceId);
|
||||||
|
const productType: string =
|
||||||
|
await this.getProductTypeByProductId(productId);
|
||||||
return {
|
return {
|
||||||
result: response.result,
|
result: {
|
||||||
success: response.success,
|
productId: productId,
|
||||||
msg: response.msg,
|
productType: productType,
|
||||||
|
status: deviceStatus.result[0].status,
|
||||||
|
},
|
||||||
|
success: deviceStatus.success,
|
||||||
|
msg: deviceStatus.msg,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new HttpException(
|
throw new HttpException(
|
||||||
|
Reference in New Issue
Block a user