|
|
|
@ -6,6 +6,7 @@ import { |
|
|
|
Post, |
|
|
|
UseGuards, |
|
|
|
Request, |
|
|
|
Get, |
|
|
|
} from '@nestjs/common' |
|
|
|
import { ApiBearerAuth, ApiOperation, ApiQuery, ApiTags } from '@nestjs/swagger' |
|
|
|
import { AuthGuard } from 'src/auth/auth.guard' |
|
|
|
@ -31,6 +32,19 @@ export class GatewayController { |
|
|
|
return { data } |
|
|
|
} |
|
|
|
|
|
|
|
@UseGuards(AuthGuard) |
|
|
|
@ApiOperation({ summary: 'List of registered devices' }) |
|
|
|
@ApiQuery({ |
|
|
|
name: 'apiKey', |
|
|
|
required: false, |
|
|
|
description: 'Required if jwt bearer token not provided', |
|
|
|
}) |
|
|
|
@Get('/devices') |
|
|
|
async getDevices(@Body() input: RegisterDeviceInputDTO, @Request() req) { |
|
|
|
const data = await this.gatewayService.getDevicesForUser(req.user) |
|
|
|
return { data } |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation({ summary: 'Update device' }) |
|
|
|
@ApiQuery({ |
|
|
|
name: 'apiKey', |
|
|
|
|