Make the house list work
This commit is contained in:
1 parent
cb8b1469cf
commit
6f5a2f422e
3 files changed
+24
-4
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user