implemented
This commit is contained in:
parent
a31bd8246c
commit
d3638e2e69
18 changed files with 1643 additions and 120 deletions
18
backend/routes/meta.py
Normal file
18
backend/routes/meta.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
"""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],
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue