handle empty return when get scene switch

This commit is contained in:
faris Aljohari
2024-11-30 20:26:34 -06:00
parent e0ec9f20ff
commit b143e50fba

View File

@ -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(