ovdashboard/api/ovdashboard_api/routers/calendar.py

15 lines
328 B
Python
Raw Normal View History

2022-09-02 19:21:15 +00:00
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()
)