15 lines
328 B
Python
15 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()
|
||
|
)
|