From 970a4b200be55bc7c7867ab0089a98a3d4d658b5 Mon Sep 17 00:00:00 2001 From: Lilian Date: Tue, 28 Feb 2023 11:56:04 +0100 Subject: [PATCH] Cleanup --- backend/api/routes/rooms/routes.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 backend/api/routes/rooms/routes.py diff --git a/backend/api/routes/rooms/routes.py b/backend/api/routes/rooms/routes.py deleted file mode 100644 index a604da4..0000000 --- a/backend/api/routes/rooms/routes.py +++ /dev/null @@ -1,24 +0,0 @@ -from fastapi import APIRouter, Depends -from services.auth import get_current_user_optional -from database.rooms.crud import create_room_with_user_db, create_room_anonymous_db, get_room_db -from schemas.rooms import AnonymousIn_schema, RoomIn_schema, Room_schema -from database.auth.models import User -router = APIRouter() - - -@router.post('/rooms', response_model=Room_schema) -async def create_room(roomData: RoomIn_schema, anonymous: AnonymousIn_schema = None, user: User = Depends(get_current_user_optional)): - if user is not None: - room = await create_room_with_user_db(room=roomData, user=user) - return await Room_schema.from_tortoise_orm(room) - else: - room = await create_room_anonymous_db(room=roomData, anonymous=anonymous) - return await Room_schema.from_tortoise_orm(room) - - -@router.get('/room/{room_id}') -async def get_room(room_id: str): - room = await get_room_db(room_id) - if room is None: - return None - return await Room_schema.from_tortoise_orm(room)