Add event routes and enhance routing structure

Introduced routes for event management, including CRUD operations and querying by user or public visibility. Updated event themes routes with operation IDs for better documentation. Refactored `api/main.py` to `api/router.py` and integrated events routing into the API.
This commit is contained in:
2025-03-05 18:57:24 +01:00
parent 4a9a37f507
commit 5c73f2720e
4 changed files with 149 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ from app.schemas.event_themes import EventThemeCreate, EventThemeResponse, Event
router = APIRouter()
@router.post("/", response_model=EventThemeResponse)
@router.post("/", response_model=EventThemeResponse, operation_id="create_event_theme")
def create_theme(
*,
db: Session = Depends(get_db),
@@ -24,7 +24,7 @@ def create_theme(
return theme
@router.get("/", response_model=List[EventThemeResponse])
@router.get("/", response_model=List[EventThemeResponse], operation_id="list_event_themes")
def list_themes(
db: Session = Depends(get_db),
skip: int = 0,
@@ -35,7 +35,7 @@ def list_themes(
return themes
@router.get("/{theme_id}", response_model=EventThemeResponse)
@router.get("/{theme_id}", response_model=EventThemeResponse, operation_id="get_event_theme")
def get_theme(
*,
db: Session = Depends(get_db),
@@ -50,7 +50,7 @@ def get_theme(
)
return theme
@router.patch("/{theme_id}", response_model=EventThemeResponse)
@router.patch("/{theme_id}", response_model=EventThemeResponse, operation_id="update_event_theme")
def update_theme(
*,
db: Session = Depends(get_db),