Filter rooms by user

This commit is contained in:
2024-09-26 16:54:36 +02:00
parent 8702aaf492
commit 08b046095f

View File

@@ -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
),
) )