mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
Load all the rooms
This commit is contained in:
@@ -70,17 +70,12 @@ class DeletionStatus(BaseModel):
|
|||||||
async def rooms_list(
|
async def rooms_list(
|
||||||
user: Annotated[Optional[auth.UserInfo], Depends(auth.current_user_optional)],
|
user: Annotated[Optional[auth.UserInfo], Depends(auth.current_user_optional)],
|
||||||
) -> list[Room]:
|
) -> list[Room]:
|
||||||
user_id = user["sub"] if user else None
|
|
||||||
|
|
||||||
if not user and not settings.PUBLIC_MODE:
|
if not user and not settings.PUBLIC_MODE:
|
||||||
raise HTTPException(status_code=401, detail="Not authenticated")
|
raise HTTPException(status_code=401, detail="Not authenticated")
|
||||||
|
|
||||||
user_id = user["sub"] if user else None
|
|
||||||
return await paginate(
|
return await paginate(
|
||||||
database,
|
database,
|
||||||
await rooms_controller.get_all(
|
await rooms_controller.get_all(order_by="-created_at", return_query=True),
|
||||||
user_id=user_id, order_by="-created_at", return_query=True
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user