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