Merge branch 'dev' into SP-201-be-handle-roles-new

This commit is contained in:
faris Aljohari
2024-05-19 17:42:24 +03:00
16 changed files with 315 additions and 36 deletions

View File

@ -61,7 +61,15 @@ export class DeviceController {
@Post('room')
async addDeviceInRoom(@Body() addDeviceInRoomDto: AddDeviceInRoomDto) {
try {
return await this.deviceService.addDeviceInRoom(addDeviceInRoomDto);
const device =
await this.deviceService.addDeviceInRoom(addDeviceInRoomDto);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'device added in room successfully',
data: device,
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',