fixed bug in ports GET

This commit is contained in:
Daniel Schick 2024-09-15 16:13:47 +02:00
parent 489dfc2ed6
commit a68a768277
2 changed files with 20 additions and 19 deletions

View File

@ -14,7 +14,7 @@ def GetPorts(token):
try:
pooledConnection = local_db.getPoolConnection()
commands = pydapper.using(pooledConnection)
data = commands.query("SELECT id, name, locode, created, modified, deleted FROM port WHERE deleted = 0 ORDER BY name", model=model.Port)
data = commands.query("SELECT id, name, locode, created, modified, deleted FROM port ORDER BY name", model=model.Port)
return json.dumps(data, default=model.obj_dict), 200, {'Content-Type': 'application/json; charset=utf-8'}
except Exception as ex:

View File

@ -34,6 +34,7 @@ class Berth(Schema):
modified: datetime
deleted: bool
@dataclass
class Port(Schema):
id: int
name: str