fixing logbook non authenticated

This commit is contained in:
2025-02-24 19:53:18 -06:00
parent 80cfa52413
commit 80f0e5437c
3 changed files with 10 additions and 11 deletions

View File

@@ -19,15 +19,10 @@ export class PilotInterceptor implements NestInterceptor {
name: pilot.name
};
});
console.log(pilots)
return pilots;
} else {
return {
partitionKey: data.partitionKey,
rowKey: data.rowKey,
id: data.id,
name: data.name
};
return data;
}
})
);

View File

@@ -7,18 +7,21 @@ import {
Param,
Post,
Put,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { PilotDto } from './pilot.dto';
import { Pilot } from './pilot.entity';
import { PilotService } from './pilot.service';
import { CustomError } from '../error/customError';
import { AuthGuard } from '@nestjs/passport'
import { Public } from '@noahspan/noahspan-modules'
import { PilotInterceptor } from './interceptors/pilot.interceptor';
@Controller('pilots')
@UseInterceptors(new PilotInterceptor())
export class PilotController {
constructor(private readonly pilotService: PilotService) {}
@Public()
@Get(':partitionKey/:rowKey')
async find(
@Param('partitionKey') partitionKey: string,
@@ -33,6 +36,7 @@ export class PilotController {
}
}
@Public()
@Get()
async findAll() {
try {

View File

@@ -122,7 +122,7 @@ const LogForm: React.FC<ILogFormProps> = ({
config
);
const entry = response.data;
console.log(entry)
methods.reset(entry);
} catch (error) {
const axiosError = error as AxiosError;
@@ -139,7 +139,7 @@ const LogForm: React.FC<ILogFormProps> = ({
}, [entryId]);
useEffect(() => {
if (pilots) {
if (pilots && FormMode.ADD) {
const newPilotsOptions = pilots.map((pilot) => {
return {
label: pilot.name,