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