mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 18:27:05 +00:00
Add endpoint to update device firmware
This commit is contained in:
@ -152,6 +152,25 @@ export class DeviceController {
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post(':deviceUuid/firmware/:firmwareVersion')
|
||||
async updateDeviceFirmware(
|
||||
@Param('deviceUuid') deviceUuid: string,
|
||||
@Param('firmwareVersion') firmwareVersion: number,
|
||||
) {
|
||||
try {
|
||||
return await this.deviceService.updateDeviceFirmware(
|
||||
deviceUuid,
|
||||
firmwareVersion,
|
||||
);
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('getaway/:gatewayUuid/devices')
|
||||
async getDevicesInGetaway(@Param('gatewayUuid') gatewayUuid: string) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user