misc fixes

This commit is contained in:
2025-11-29 12:59:56 -06:00
parent a4fdd93ede
commit 5100a93659
29 changed files with 124 additions and 476 deletions

View File

@@ -30,14 +30,8 @@ import { join } from 'path';
isGlobal: true,
load: [configuration]
}),
// HealthModule,
HealthModule,
LogModule,
PilotModule,
ServeStaticModule.forRoot({
rootPath: join(__dirname, '../..', 'client', 'dist')
}),
TrackModule,
TypeOrmModule.forRoot(dataSourceOptions),
MsGraphModule.registerAsync({
inject: [ConfigService],
imports: [ConfigModule],
@@ -48,7 +42,13 @@ import { join } from 'path';
tenantId: configService.get<string>('tenantId')
}
}
})
}),
PilotModule,
ServeStaticModule.forRoot({
rootPath: join(__dirname, '../..', 'client', 'dist')
}),
TrackModule,
TypeOrmModule.forRoot(dataSourceOptions)
],
providers: [
{

View File

@@ -37,11 +37,10 @@ export class LogController {
@Param('id') id: string,
): Promise<LogEntity> {
try {
console.log(id)
return await this.logService.find(id);
} catch (error) {
const customError = error as CustomError;
console.log(error)
throw new HttpException(customError.message, customError.statusCode);
}
}
@@ -50,11 +49,10 @@ export class LogController {
@Public()
async findAll(): Promise<LogEntity[]> {
try {
console.log('blah')
return await this.logService.findAll();
} catch (error) {
const customError = error as CustomError;
console.log(error)
throw new HttpException(customError.message, customError.statusCode);
}
}
@@ -67,7 +65,7 @@ export class LogController {
return await this.logService.create(logDto);
} catch (error) {
const customError = error as CustomError;
console.log(error)
throw new HttpException(customError.message, customError.statusCode);
}
}
@@ -79,12 +77,10 @@ export class LogController {
@Body() logDto: LogDto
): Promise<UpdateResult> {
try {
console.log(id)
console.log(logDto)
return await this.logService.update(id, logDto);
} catch (error) {
const customError = error as CustomError;
console.log(error)
throw new HttpException(customError.message, customError.statusCode);
}
}
@@ -97,7 +93,6 @@ export class LogController {
try {
return await this.logService.delete(id);
} catch (error) {
console.log(error)
const customError = error as CustomError;
throw new HttpException(customError.message, customError.statusCode);

View File

@@ -43,7 +43,7 @@ export class PilotController {
return await this.pilotService.findAll();
} catch (error) {
const customError = error as CustomError;
console.log(error)
throw new HttpException(customError.message, customError.statusCode);
}
}
@@ -55,10 +55,9 @@ export class PilotController {
return await this.pilotService.create(pilotDto);
} catch (error) {
console.log(error)
// const customError = error as CustomError;
const customError = error as CustomError;
// throw new HttpException(customError.message, customError.statusCode);
throw new HttpException(customError.message, customError.statusCode);
}
}

View File

@@ -26,7 +26,7 @@ export class PilotInterceptor implements NestInterceptor {
};
})
}
console.log(req.headers.authorization)
if (req.headers.authorization) {
const authHeader = req.headers.authorization;
const token = authHeader && authHeader.split(' ')[1];