Make the house list work

This commit is contained in:
Jacob Windsor committed 2025-02-19 15:09:45 +01:00
1 parent cb8b1469cf
commit 6f5a2f422e
3 files changed
+24 -4

No files matched your search

+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()