misc fixes
This commit is contained in:
@@ -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: [
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user