fixing logbook non authenticated
This commit is contained in:
@@ -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;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user