Add ProductType enum and implement getDevicesInGetaway method

This commit is contained in:
faris Aljohari
2024-05-11 22:25:43 +03:00
parent c5e8cc1898
commit 6b881ce01e
3 changed files with 89 additions and 23 deletions

View File

@ -150,4 +150,17 @@ export class DeviceController {
);
}
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Get('getaway/:gatewayUuid/devices')
async getDevicesInGetaway(@Param('gatewayUuid') gatewayUuid: string) {
try {
return await this.deviceService.getDevicesInGetaway(gatewayUuid);
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
}
}