mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 22:47:54 +00:00
fixed automation dto
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
BadRequestException,
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
Injectable,
|
||||
} from '@nestjs/common';
|
||||
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||
import { GetSpaceParam } from '../dtos';
|
||||
import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
import { SpaceService } from './space.service';
|
||||
@@ -42,8 +37,8 @@ export class SpaceSceneService {
|
||||
} catch (error) {
|
||||
console.error('Error retrieving scenes:', error);
|
||||
|
||||
if (error instanceof BadRequestException) {
|
||||
throw new HttpException(error.message, HttpStatus.BAD_REQUEST);
|
||||
if (error instanceof HttpException) {
|
||||
throw error;
|
||||
} else {
|
||||
throw new HttpException(
|
||||
'An error occurred while retrieving scenes',
|
||||
|
||||
@@ -112,12 +112,6 @@ export class SubspaceDeviceService {
|
||||
}
|
||||
|
||||
device.subspace = null;
|
||||
|
||||
console.log(
|
||||
'Starting to save device with null subspace:',
|
||||
new Date(),
|
||||
device.subspace,
|
||||
);
|
||||
const updatedDevice = await this.deviceRepository.save(device);
|
||||
|
||||
return new SuccessResponseDto({
|
||||
@@ -217,7 +211,7 @@ export class SubspaceDeviceService {
|
||||
} as GetDeviceDetailsInterface;
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
'Error fetching device details from Tuya',
|
||||
`Error fetching device details from Tuya for device uuid ${deviceId}.`,
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user