Merge pull request #139 from SyncrowIOT/feature/space-management

Feature/space management
This commit is contained in:
faris Aljohari
2024-11-05 03:15:31 -06:00
committed by GitHub
24 changed files with 595 additions and 208 deletions
+4 -4
View File
@@ -157,7 +157,7 @@ export class SceneService {
);
} else {
throw new HttpException(
'An Internal error has been occured',
`An Internal error has been occured ${err}`,
HttpStatus.INTERNAL_SERVER_ERROR,
);
}
@@ -172,13 +172,13 @@ export class SceneService {
const scenesData = await this.sceneRepository.find({
where: {
spaceUuid,
...(showInHomePage !== undefined ? { showInHomePage } : {}),
...(showInHomePage ? { showInHomePage } : {}),
},
});
if (!scenesData.length) {
throw new HttpException(
`No scenes found for space UUID ${spaceUuid}`,
`No scenes found for space UUID ${spaceUuid} with showInHomePage ${showInHomePage} `,
HttpStatus.NOT_FOUND,
);
}
@@ -199,7 +199,7 @@ export class SceneService {
err.message,
);
if (err instanceof BadRequestException) {
if (err instanceof HttpException) {
throw err;
} else {
throw new HttpException(