Skip to content

Commit e04e0d4

Browse files
committed
feat: remove route api
1 parent 055b26c commit e04e0d4

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

‎src/modules/audit_log/repository.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl TryFrom<AuditLogRecord> for AuditLog {
246246

247247
let incomplete_error = || InvalidAuditLogEntityKind(format!("incomplete {entity_kind}"));
248248

249-
let entity_id = |id: Option<Uuid>| id.ok_or_else(|| incomplete_error());
249+
let entity_id = |id: Option<Uuid>| id.ok_or_else(&incomplete_error);
250250
let entity = match entity_kind {
251251
AuditLogEntityKind::Event => AuditLogEntity::Event(entity_id(record.entity_id)?),
252252
AuditLogEntityKind::AtcApplication => {

‎src/modules/flight/routes/flights.rs‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ use axum::{Json, Router};
99
use tokio::time;
1010

1111
use 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};
1413
use crate::modules::flight::flight_plan::validator;
1514
use crate::modules::flight::models::Flight;
1615
use crate::modules::flight::service::FlightService;
1716
use crate::modules::user::middleware::CurrentUser;
17+
use crate::modules::user::models::UserRole;
1818
use crate::services::Services;
1919

2020
const 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>)))]
10594
async fn temporary_warnings(
10695
current_user: CurrentUser,

0 commit comments

Comments
 (0)