add some description entries for the UI
This commit is contained in:
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
|
||||
import { InjectModel } from '@nestjs/mongoose';
|
||||
import { Model } from 'mongoose';
|
||||
import { ActiveRunwaysDto } from './dto/activerunways.dto';
|
||||
import { AirportOverviewDto } from './dto/airportoverview.dto';
|
||||
import { Airport, AirportDocument } from './models/airport.model';
|
||||
|
||||
@Injectable()
|
||||
@@ -17,11 +18,17 @@ export class AirportService {
|
||||
.then((response) => response && response.length !== 0);
|
||||
}
|
||||
|
||||
async airportsList(): Promise<string[]> {
|
||||
async allAirports(): Promise<AirportOverviewDto[]> {
|
||||
return this.airportModel.find({}).then((response) => {
|
||||
const icaoCodes: string[] = [];
|
||||
response.forEach((airport) => icaoCodes.push(airport.icao));
|
||||
return icaoCodes;
|
||||
const retval: AirportOverviewDto[] = [];
|
||||
response.forEach((airport) =>
|
||||
retval.push({
|
||||
icao: airport.icao,
|
||||
name: airport.name,
|
||||
flightInformationRegion: airport.flightInformationRegion,
|
||||
}),
|
||||
);
|
||||
return retval;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user