From 71589fe1b44d883f2202492d0665708f7f97610a Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Tue, 25 Oct 2022 08:26:10 +0200 Subject: [PATCH] return the async function --- src/airport/airport.service.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/airport/airport.service.ts b/src/airport/airport.service.ts index 5936c94..199e6ba 100644 --- a/src/airport/airport.service.ts +++ b/src/airport/airport.service.ts @@ -32,19 +32,17 @@ export class AirportService { } async registerAirport(airport: Airport): Promise { - this.airportExists(airport.icao).then(async (exists) => { + return this.airportExists(airport.icao).then(async (exists) => { if (!exists) { await this.airportModel.create(airport); } return !exists; }); - - return false; } async updateAirport(airport: Airport): Promise { - this.airportExists(airport.icao).then(async (exists) => { + return this.airportExists(airport.icao).then(async (exists) => { if (exists) { await this.airportModel.findOneAndUpdate( { icao: airport.icao }, @@ -54,8 +52,6 @@ export class AirportService { return exists; }); - - return false; } async deleteAirport(icao: string): Promise {