fix: Remove non-existent owner_type/owner_id columns from city_rooms queries

- Fix get_all_rooms() to not select owner_type/owner_id
- Fix get_city_rooms_for_list() to not select owner_type/owner_id
- Fix get_city_rooms_api() to use space_scope instead of owner_type
- This fixes 500 error on /api/city/rooms endpoint
This commit is contained in:
Apple
2025-12-05 02:52:03 -08:00
parent ad3026e32d
commit 72b76bf29f
2 changed files with 3 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ async def get_all_rooms(limit: int = 100, offset: int = 0) -> List[dict]:
query = """
SELECT
cr.id, cr.slug, cr.name, cr.description,
cr.room_type, cr.owner_type, cr.owner_id, cr.space_scope, cr.visibility,
cr.room_type, cr.space_scope, cr.visibility,
cr.is_default, cr.is_public, cr.sort_order,
cr.created_at, cr.created_by,
cr.matrix_room_id, cr.matrix_room_alias,
@@ -92,7 +92,7 @@ async def get_city_rooms_for_list(limit: int = 100) -> List[dict]:
query = """
SELECT
cr.id, cr.slug, cr.name, cr.description,
cr.room_type, cr.owner_type, cr.owner_id, cr.space_scope, cr.visibility,
cr.room_type, cr.space_scope, cr.visibility,
cr.is_public, cr.sort_order,
cr.matrix_room_id, cr.matrix_room_alias,
cr.logo_url, cr.banner_url,

View File

@@ -1253,7 +1253,7 @@ async def get_city_rooms_api():
"slug": room.get("slug"),
"name": room.get("name"),
"description": room.get("description"),
"scope": room.get("owner_type", "city"),
"scope": room.get("space_scope", "city"),
"matrix_room_id": room.get("matrix_room_id"),
"is_public": room.get("is_public", True),
"room_role": room.get("room_role"),