adding pilot details view
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
"@nestjs/core": "^10.0.0",
|
||||
"@nestjs/passport": "^10.0.3",
|
||||
"@nestjs/platform-express": "^10.0.0",
|
||||
"@noahspan/noahspan-modules": "^0.3.9",
|
||||
"@noahspan/noahspan-modules": "^0.4.0",
|
||||
"@schematics/angular": "^17.3.7",
|
||||
"dotenv": "^16.4.5",
|
||||
"reflect-metadata": "0.1.13",
|
||||
|
||||
@@ -11,9 +11,9 @@ export class PilotInfoService {
|
||||
|
||||
constructor(private readonly tableService: TableService) {}
|
||||
|
||||
// async find(rowKey: string): Promise<PilotInfo> {
|
||||
// return await this.pilotInfoRepository.find(this.partitionKey, rowKey);
|
||||
// }
|
||||
async find(rowKey: string): Promise<PilotInfoEntity> {
|
||||
return await this.pilotInfoRepository.find(this.partitionKey, rowKey);
|
||||
}
|
||||
|
||||
async findAll(): Promise<PilotInfoEntity[]> {
|
||||
try {
|
||||
|
||||
16
api/src/pilot/interceptors/pilot.interceptor.ts
Normal file
16
api/src/pilot/interceptors/pilot.interceptor.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
||||
import { Observable, map } from 'rxjs';
|
||||
|
||||
export class PilotInterceptor implements NestInterceptor {
|
||||
intercept(context: ExecutionContext, handler: CallHandler): Observable<any> {
|
||||
const req = context.switchToHttp().getRequest();
|
||||
const authHeader = req.headers.authorization;
|
||||
const token = authHeader && authHeader.split(' ')[1];
|
||||
|
||||
if (!token) {
|
||||
return handler.handle().pipe(map((data) => data));
|
||||
}
|
||||
|
||||
return handler.handle().pipe(map((data) => data));
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,26 @@
|
||||
import { Body, Controller, Get, HttpException, Post } from '@nestjs/common';
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
HttpException,
|
||||
Post,
|
||||
UseInterceptors
|
||||
} from '@nestjs/common';
|
||||
import { PilotInfoService } from './info/pilot-info.service';
|
||||
import { PilotInfoDto } from './info/pilot-info.dto';
|
||||
import { TableInsertEntityHeaders } from '@azure/data-tables';
|
||||
import { CustomError } from '../customError/CustomError';
|
||||
import { PilotInfoEntity } from './info/pilot-info.entity';
|
||||
import { AuthInterceptor } from 'src/interceptors/auth.interceptor';
|
||||
import { Public } from '@noahspan/noahspan-modules';
|
||||
|
||||
@Controller('pilots')
|
||||
export class PilotController {
|
||||
constructor(private readonly pilotInfoService: PilotInfoService) {}
|
||||
|
||||
@Get()
|
||||
@Public()
|
||||
@UseInterceptors(AuthInterceptor)
|
||||
async findAll(): Promise<PilotInfoEntity[]> {
|
||||
try {
|
||||
const pilots: PilotInfoEntity[] = await this.pilotInfoService.findAll();
|
||||
|
||||
4
infrastructure/dns.tf
Normal file
4
infrastructure/dns.tf
Normal file
@@ -0,0 +1,4 @@
|
||||
data "azurerm_dns_zone" "dns_zone" {
|
||||
name = var.DOMAIN_NAME
|
||||
resource_group_name = data.azurerm_resource_group.resource_group.name
|
||||
}
|
||||
@@ -1,9 +1,31 @@
|
||||
module "static_web_app" {
|
||||
source = "github.com/noahspannbauer/noahspan-root/infrastructure/modules/static_web_app"
|
||||
region = var.REGION
|
||||
# module "static_web_app" {
|
||||
# source = "github.com/noahspannbauer/noahspan-root/infrastructure/modules/static_web_app"
|
||||
# region = var.REGION
|
||||
# resource_group_name = data.azurerm_resource_group.resource_group.name
|
||||
# static_web_app_name = var.STATIC_WEB_APP_NAME
|
||||
# custom_domain_name_count = var.CUSTOM_DOMAIN_NAME_COUNT
|
||||
# domain_name = var.DOMAIN_NAME
|
||||
# subdomain_name = var.SUBDOMAIN_NAME
|
||||
# }
|
||||
|
||||
resource "azurerm_static_web_app" "static_web_app" {
|
||||
name = var.STATIC_WEB_APP_NAME
|
||||
resource_group_name = data.azurerm_resource_group.resource_group.name
|
||||
static_web_app_name = var.STATIC_WEB_APP_NAME
|
||||
custom_domain_name_count = var.CUSTOM_DOMAIN_NAME_COUNT
|
||||
domain_name = var.DOMAIN_NAME
|
||||
subdomain_name = var.SUBDOMAIN_NAME
|
||||
location = var.REGION
|
||||
}
|
||||
|
||||
resource "azurerm_dns_cname_record" "dns_cname_record" {
|
||||
name = var.SUBDOMAIN_NAME
|
||||
zone_name = data.azurerm_dns_zone.dns_zone.name
|
||||
resource_group_name = data.azurerm_resource_group.resource_group.name
|
||||
ttl = 14400
|
||||
record = azurerm_static_web_app.static_web_app.default_host_name
|
||||
}
|
||||
|
||||
resource "azurerm_static_web_app_custom_domain" "static_web_app_custom_domain" {
|
||||
static_web_app_id = azurerm_static_web_app.static_web_app.id
|
||||
domain_name = "${var.SUBDOMAIN_NAME}.${var.DOMAIN_NAME}"
|
||||
validation_type = "cname-delegation"
|
||||
|
||||
depends_on = [ azurerm_dns_cname_record.dns_cname_record ]
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
output "api_key" {
|
||||
value = module.static_web_app.api_key
|
||||
value = azurerm_static_web_app.static_web_app.api_key
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "default_host_name" {
|
||||
value = module.static_web_app.default_host_name
|
||||
value = azurerm_static_web_app.static_web_app.default_host_name
|
||||
}
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -40,7 +40,7 @@
|
||||
"@nestjs/core": "^10.0.0",
|
||||
"@nestjs/passport": "^10.0.3",
|
||||
"@nestjs/platform-express": "^10.0.0",
|
||||
"@noahspan/noahspan-modules": "^0.3.9",
|
||||
"@noahspan/noahspan-modules": "^0.4.0",
|
||||
"@schematics/angular": "^17.3.7",
|
||||
"dotenv": "^16.4.5",
|
||||
"reflect-metadata": "0.1.13",
|
||||
@@ -3431,9 +3431,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@noahspan/noahspan-modules": {
|
||||
"version": "0.3.9",
|
||||
"resolved": "https://registry.npmjs.org/@noahspan/noahspan-modules/-/noahspan-modules-0.3.9.tgz",
|
||||
"integrity": "sha512-gRW+DiXQP+/0vHvEBi5yijQwwUnP+z5YxlSU7Q/bzm7YdUv5ecbZrz4is+BzH1S6Ctds9DeoQKtvb9xbAKwg8w==",
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@noahspan/noahspan-modules/-/noahspan-modules-0.4.0.tgz",
|
||||
"integrity": "sha512-oFOFL6AiEVlNmURAxDdnKg6xNZVZhQOPNeDtwWwbgYf2CQAHOapiBpKwHDAWT7DVpoBEurvmDEXeCHGl8mhGUw==",
|
||||
"dependencies": {
|
||||
"@azure/app-configuration": "^1.6.0",
|
||||
"@azure/data-tables": "^13.2.2",
|
||||
|
||||
Reference in New Issue
Block a user