Make the house list work
This commit is contained in:
@@ -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