kaas
This commit is contained in:
@@ -37,7 +37,6 @@ from permissions import (
|
|||||||
|
|
||||||
from rooms import (
|
from rooms import (
|
||||||
create_room,
|
create_room,
|
||||||
search_room,
|
|
||||||
accept_room,
|
accept_room,
|
||||||
get_rooms,
|
get_rooms,
|
||||||
get_room,
|
get_room,
|
||||||
@@ -376,32 +375,6 @@ def api_create_room(
|
|||||||
**result,
|
**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(
|
@app.post(
|
||||||
"/join-room",
|
"/join-room",
|
||||||
summary="Join a room",
|
summary="Join a room",
|
||||||
|
|||||||
Reference in New Issue
Block a user