1313from src .models .environment import EnvironmentModel
1414from src .models .flight import FlightModel
1515from src .models .rocket import RocketModel
16- from src .models .motor import MotorKinds
1716from src .controllers .flight import FlightController
1817
1918router = APIRouter (
3029
3130
3231@router .post ("/" , status_code = 201 )
33- async def create_flight (
34- flight : FlightModel , motor_kind : MotorKinds
35- ) -> FlightCreated :
32+ async def create_flight (flight : FlightModel ) -> FlightCreated :
3633 """
3734 Creates a new flight
3835
@@ -41,7 +38,6 @@ async def create_flight(
4138 """
4239 with tracer .start_as_current_span ("create_flight" ):
4340 controller = FlightController ()
44- flight .rocket .motor .set_motor_kind (motor_kind )
4541 return await controller .post_flight (flight )
4642
4743
@@ -59,9 +55,7 @@ async def read_flight(flight_id: str) -> FlightRetrieved:
5955
6056
6157@router .put ("/{flight_id}" , status_code = 204 )
62- async def update_flight (
63- flight_id : str , flight : FlightModel , motor_kind : MotorKinds
64- ) -> None :
58+ async def update_flight (flight_id : str , flight : FlightModel ) -> None :
6559 """
6660 Updates an existing flight
6761
@@ -73,7 +67,6 @@ async def update_flight(
7367 """
7468 with tracer .start_as_current_span ("update_flight" ):
7569 controller = FlightController ()
76- flight .rocket .motor .set_motor_kind (motor_kind )
7770 return await controller .put_flight_by_id (flight_id , flight )
7871
7972
@@ -144,11 +137,7 @@ async def update_flight_environment(
144137
145138
146139@router .put ("/{flight_id}/rocket" , status_code = 204 )
147- async def update_flight_rocket (
148- flight_id : str ,
149- rocket : RocketModel ,
150- motor_kind : MotorKinds ,
151- ) -> None :
140+ async def update_flight_rocket (flight_id : str , rocket : RocketModel ) -> None :
152141 """
153142 Updates flight rocket.
154143
@@ -160,7 +149,6 @@ async def update_flight_rocket(
160149 """
161150 with tracer .start_as_current_span ("update_flight_rocket" ):
162151 controller = FlightController ()
163- rocket .motor .set_motor_kind (motor_kind )
164152 return await controller .update_rocket_by_flight_id (
165153 flight_id ,
166154 rocket = rocket ,
0 commit comments