mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
Filter rooms by user
This commit is contained in:
@@ -73,9 +73,13 @@ async def rooms_list(
|
|||||||
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(order_by="-created_at", return_query=True),
|
await rooms_controller.get_all(
|
||||||
|
user_id=user_id, order_by="-created_at", return_query=True
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user