18 lines
603 B
Python
18 lines
603 B
Python
"""Meta endpoints for shared constants."""
|
|
from fastapi import APIRouter
|
|
|
|
from models import Permission, InviteStatus, ROLE_ADMIN, ROLE_REGULAR
|
|
from schemas import ConstantsResponse
|
|
|
|
router = APIRouter(prefix="/api/meta", tags=["meta"])
|
|
|
|
|
|
@router.get("/constants", response_model=ConstantsResponse)
|
|
async def get_constants() -> ConstantsResponse:
|
|
"""Get shared constants for frontend/backend synchronization."""
|
|
return ConstantsResponse(
|
|
permissions=[p.value for p in Permission],
|
|
roles=[ROLE_ADMIN, ROLE_REGULAR],
|
|
invite_statuses=[s.value for s in InviteStatus],
|
|
)
|
|
|