Add created_at field to User and Item models and update endpoints (#2144)

This commit is contained in:
Alejandra
2026-01-23 16:18:22 +01:00
committed by GitHub
parent 2720308701
commit 3c1f7c4cdb
6 changed files with 78 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ def read_users(session: SessionDep, skip: int = 0, limit: int = 100) -> Any:
count_statement = select(func.count()).select_from(User)
count = session.exec(count_statement).one()
statement = select(User).offset(skip).limit(limit)
statement = select(User).order_by(User.created_at.desc()).offset(skip).limit(limit)
users = session.exec(statement).all()
return UsersPublic(data=users, count=count)