mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 11:14:53 +00:00
handle empty return when get scene switch
This commit is contained in:
@ -1349,10 +1349,7 @@ export class DeviceService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!sceneDevice) {
|
if (!sceneDevice) {
|
||||||
throw new HttpException(
|
return {};
|
||||||
`No scene found for device with UUID ${deviceUuid} and switch name ${getSceneFourSceneDeviceDto.switchName}`,
|
|
||||||
HttpStatus.NOT_FOUND,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const sceneDetails = await this.sceneService.getSceneByUuid(
|
const sceneDetails = await this.sceneService.getSceneByUuid(
|
||||||
@ -1376,10 +1373,7 @@ export class DeviceService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!sceneDevices.length) {
|
if (!sceneDevices.length) {
|
||||||
throw new HttpException(
|
return [];
|
||||||
`No scenes found for device with UUID ${deviceUuid}`,
|
|
||||||
HttpStatus.NOT_FOUND,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const results = await Promise.all(
|
const results = await Promise.all(
|
||||||
|
|||||||
Reference in New Issue
Block a user