ovdashboard/api/ovdashboard_api/routers/calendar.py

14 lines
328 B
Python

from fastapi import APIRouter
from .. import caldav_principal
router = APIRouter(prefix="/calendar", tags=["calendar"])
@router.get("/list", response_model=list[str])
async def list_calendars() -> list[str]:
principal = caldav_principal()
return list(
cal.name
for cal in principal.calendars()
)