mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 07:37:55 +00:00
Add endpoint to get devices by unit ID
This commit is contained in:
@@ -83,7 +83,19 @@ export class DeviceController {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('unit/:unitUuid')
|
||||
async getDevicesByUnitId(@Param('unitUuid') unitUuid: string) {
|
||||
try {
|
||||
return await this.deviceService.getDevicesByUnitId(unitUuid);
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard, CheckRoomGuard)
|
||||
@Put('room')
|
||||
|
||||
Reference in New Issue
Block a user