From ae9dbd2fc9fbbf2a1c611ad72f99b194577f82ef Mon Sep 17 00:00:00 2001 From: GabrielBarberini Date: Mon, 20 May 2024 23:49:56 -0300 Subject: [PATCH] refactors routes --- lib/routes/environment.py | 2 +- lib/routes/flight.py | 2 +- lib/routes/motor.py | 4 ++-- lib/routes/rocket.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/routes/environment.py b/lib/routes/environment.py index d3c8dec..91d70ef 100644 --- a/lib/routes/environment.py +++ b/lib/routes/environment.py @@ -91,4 +91,4 @@ async def simulate_env(env_id: str) -> "EnvSummary": ## Args ``` env_id: str ``` """ - return await EnvController.simulate(env_id) + return await EnvController.simulate_env(env_id) diff --git a/lib/routes/flight.py b/lib/routes/flight.py index 35ea88f..e920041 100644 --- a/lib/routes/flight.py +++ b/lib/routes/flight.py @@ -62,7 +62,7 @@ async def read_rocketpy_flight(flight_id: int) -> "FlightPickle": ## Args ``` flight_id: Flight ID hash. ``` """ - return await FlightController.get_rocketpy_flight(flight_id) + return await FlightController.get_rocketpy_flight_as_jsonpickle(flight_id) @router.put("/{flight_id}/env") diff --git a/lib/routes/motor.py b/lib/routes/motor.py index 85ad263..5f0ef26 100644 --- a/lib/routes/motor.py +++ b/lib/routes/motor.py @@ -82,7 +82,7 @@ async def read_rocketpy_motor(motor_id: int) -> "MotorPickle": ## Args ``` motor_id: Motor ID hash ``` """ - return await MotorController.get_rocketpy_motor(motor_id) + return await MotorController.get_rocketpy_motor_as_jsonpickle(motor_id) @router.get("/{motor_id}/simulate") @@ -93,4 +93,4 @@ async def simulate_motor(motor_id: int) -> "MotorSummary": ## Args ``` motor_id: Motor ID hash ``` """ - return await MotorController.simulate(motor_id) + return await MotorController.simulate_motor(motor_id) diff --git a/lib/routes/rocket.py b/lib/routes/rocket.py index 6bd45c1..40789eb 100644 --- a/lib/routes/rocket.py +++ b/lib/routes/rocket.py @@ -103,4 +103,4 @@ async def simulate_rocket(rocket_id: int) -> "RocketSummary": ## Args ``` rocket_id: Rocket ID hash ``` """ - return await RocketController.simulate(rocket_id) + return await RocketController.simulate_rocket(rocket_id)