summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-09-01 23:38:43 +0200
committerBotond Hende <nettingman@gmail.com>2024-09-01 23:38:43 +0200
commit3a390ff218903b8665a99f94d7f3a65357b6e96d (patch)
treeb4c9c4679d931ef59977518e98be6ff4b16843f6
parenta994b822a4231061153c6b27d8c5d7307b59f8b0 (diff)
removed unnecessary code
-rw-r--r--apirouters/customize_ship.py1
-rw-r--r--apirouters/tasks.py5
2 files changed, 3 insertions, 3 deletions
diff --git a/apirouters/customize_ship.py b/apirouters/customize_ship.py
index 7be3279..c69d421 100644
--- a/apirouters/customize_ship.py
+++ b/apirouters/customize_ship.py
@@ -11,6 +11,7 @@ class RenameBody(BaseModel):
name: str
+# TODO depend on ship instead of auth_agent
@router.post("/customize_ship/{ship_symbol}/rename")
async def rename(ship_symbol: str, rename_body: RenameBody, agent: Annotated[Agent, Depends(auth_agent)]):
for current_ship in agent.ships.values():
diff --git a/apirouters/tasks.py b/apirouters/tasks.py
index 6cc9a25..02e091b 100644
--- a/apirouters/tasks.py
+++ b/apirouters/tasks.py
@@ -1,7 +1,8 @@
from typing import Annotated
from fastapi import APIRouter, Depends
+from pydantic import BaseModel
-from ..modules import task_type
+from ..modules import task_types
from .agents import auth_agent, Agent
router = APIRouter()
@@ -11,7 +12,6 @@ router = APIRouter()
async def get_tasks(agent: Annotated[Agent, Depends(auth_agent)]):
ships = []
for current_ship in agent.ships.values():
- current_ship.load_task()
ships.append(current_ship.get_data())
return {"ships": ships}
@@ -21,7 +21,6 @@ async def get_tasks(agent: Annotated[Agent, Depends(auth_agent)]):
async def get_tasks(ship_symbol: str, agent: Annotated[Agent, Depends(auth_agent)]):
for current_ship in agent.ships.values():
if current_ship.symbol == ship_symbol:
- current_ship.load_task()
return current_ship.get_data()
return {"error": "Unknown ship symbol."}