Make the house list work

This commit is contained in:
Jacob Windsor
2025-02-19 15:09:45 +01:00
parent cb8b1469cf
commit 6f5a2f422e
3 changed files with 24 additions and 4 deletions
+2 -2
View File
@@ -11,8 +11,8 @@ class HouseRepository:
def __init__(self, session: Annotated[AsyncSession, Depends(get_session)]) -> None:
self.session = session
async def get_all(self) -> list[House]:
statement = select(House)
async def get_all(self, limit: int = 100, offset: int = 0) -> list[House]:
statement = select(House).offset(offset).limit(limit)
result = await self.session.execute(statement)
return result.scalars().all()