@@ -9,12 +9,12 @@ use axum::{Json, Router};
99use tokio:: time;
1010
1111use crate :: error:: ApiError ;
12- use crate :: modules:: user:: models:: UserRole ;
13- use crate :: modules:: flight:: dto:: { FlightDto , FlightLeg , TemporaryFlightQuery } ;
12+ use crate :: modules:: flight:: dto:: { FlightDto , TemporaryFlightQuery } ;
1413use crate :: modules:: flight:: flight_plan:: validator;
1514use crate :: modules:: flight:: models:: Flight ;
1615use crate :: modules:: flight:: service:: FlightService ;
1716use crate :: modules:: user:: middleware:: CurrentUser ;
17+ use crate :: modules:: user:: models:: UserRole ;
1818use crate :: services:: Services ;
1919
2020const VALIDATION_REFRESH_INTERVAL : Duration = Duration :: from_secs ( 30 ) ;
@@ -24,7 +24,6 @@ const VALIDATION_REFRESH_INTERVAL: Duration = Duration::from_secs(30);
2424 active_flights,
2525 flight_by_callsign,
2626 warnings_by_callsign,
27- route_by_callsign,
2827 my_flight,
2928 temporary_warnings
3029) ) ]
@@ -39,7 +38,6 @@ pub fn build_flight_routes() -> Router<Services> {
3938 "/by-callsign/{callsign}/warnings" ,
4039 get ( warnings_by_callsign) ,
4140 )
42- . route ( "/by-callsign/{callsign}/route" , get ( route_by_callsign) )
4341 . route ( "/mine" , get ( my_flight) )
4442 . route ( "/temporary/by-plan/warnings" , get ( temporary_warnings) )
4543}
@@ -92,15 +90,6 @@ async fn warnings_websocket(
9290 )
9391}
9492
95- #[ utoipa:: path( get, path = "api/flights/by-callsign/{callsign}/route" , tag = "Flights" , params( ( "callsign" = String , Path , description = "Callsign" ) ) , responses( ( status = 200 , description = "Successful response" , body = Vec <FlightLeg >) ) ) ]
96- async fn route_by_callsign (
97- State ( services) : State < Services > ,
98- Path ( callsign) : Path < String > ,
99- ) -> Result < Json < Vec < FlightLeg > > , ApiError > {
100- let legs = services. flight ( ) . route_by_callsign ( & callsign) . await ?;
101- Ok ( Json ( legs. into_iter ( ) . map ( FlightLeg :: from) . collect ( ) ) )
102- }
103-
10493#[ utoipa:: path( get, path = "api/flights/temporary/by-plan/warnings" , tag = "Flights" , security( ( "oauth2" = [ ] ) ) , responses( ( status = 200 , description = "Successful response" , body = Vec <validator:: WarningMessage >) ) ) ]
10594async fn temporary_warnings (
10695 current_user : CurrentUser ,
0 commit comments