This commit is contained in:
ben
2026-08-18 14:43:14 +02:00
parent 3d3270988c
commit 63b4ee2a6f
2 changed files with 340 additions and 1 deletions
+27
View File
@@ -37,6 +37,7 @@ from permissions import (
from rooms import (
create_room,
search_room,
accept_room,
get_rooms,
get_room,
@@ -375,6 +376,32 @@ def api_create_room(
**result,
}
@app.post(
"/search-room",
summary="Search for a room",
description="Searches for a room using its invite code.",
)
def api_search_room(
room: RoomSearch,
user_id: int = Depends(get_current_user),
):
room_name = search_room(
room.invite_code,
)
if room_name is None:
return {
"status": "failed",
"reason": "room_not_found",
}
return {
"status": "found",
"room_name": room_name,
}
@app.post(
"/join-room",
summary="Join a room",