protect the airport endpoints
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
Query,
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiBody, ApiQuery, ApiResponse } from '@nestjs/swagger';
|
||||
import { AirportService } from './airport.service';
|
||||
@@ -32,6 +33,7 @@ import { ActiveRunwaysDto } from './dto/activerunways.dto';
|
||||
import { Runway } from './models/runway.model';
|
||||
import { RunwayDto } from './dto/runway.dto';
|
||||
import { AirportOverviewDto } from './dto/airportoverview.dto';
|
||||
import { JwtGuard } from 'src/auth/guards/jwt.guard';
|
||||
|
||||
@Controller('airport')
|
||||
export class AirportController {
|
||||
@@ -246,6 +248,7 @@ export class AirportController {
|
||||
});
|
||||
}
|
||||
|
||||
@UseGuards(JwtGuard)
|
||||
@Get('/all')
|
||||
@ApiResponse({
|
||||
status: 200,
|
||||
@@ -256,6 +259,7 @@ export class AirportController {
|
||||
return this.airportService.allAirports();
|
||||
}
|
||||
|
||||
@UseGuards(JwtGuard)
|
||||
@Get('/get')
|
||||
@ApiQuery({
|
||||
name: 'icao',
|
||||
@@ -280,6 +284,7 @@ export class AirportController {
|
||||
});
|
||||
}
|
||||
|
||||
@UseGuards(JwtGuard)
|
||||
@Post('/register')
|
||||
@ApiBody({
|
||||
description: 'The airport definition',
|
||||
@@ -317,6 +322,7 @@ export class AirportController {
|
||||
});
|
||||
}
|
||||
|
||||
@UseGuards(JwtGuard)
|
||||
@Delete('/remove')
|
||||
@ApiQuery({
|
||||
name: 'icao',
|
||||
@@ -340,6 +346,7 @@ export class AirportController {
|
||||
});
|
||||
}
|
||||
|
||||
@UseGuards(JwtGuard)
|
||||
@Patch('/activateRunways')
|
||||
@ApiBody({
|
||||
description: 'The airport definition',
|
||||
|
||||
Reference in New Issue
Block a user