Moved sorting back to the get_accounts
This commit is contained in:
@ -36,8 +36,12 @@ def get_account_names(
|
||||
|
||||
def get_accounts(engine: Engine, user_id: int) -> list[models.Account]:
|
||||
"""Returns a list of accounts of a user"""
|
||||
statement = sqlmodel.select(models.Account).where(
|
||||
models.Account.user_id == user_id,
|
||||
statement = (
|
||||
sqlmodel.select(models.Account)
|
||||
.where(
|
||||
models.Account.user_id == user_id,
|
||||
)
|
||||
.order_by(models.Account.name)
|
||||
)
|
||||
with sqlmodel.Session(engine) as session:
|
||||
result = session.exec(statement).fetchall()
|
||||
|
Reference in New Issue
Block a user