members.lumbung.space/members_lumbung_space/routes/root.py
cellarspoon 566bf395fe
init
2022-01-10 13:34:17 +01:00

22 lines
506 B
Python

"""Home routes."""
from fastapi import APIRouter, Depends, Request
from members_lumbung_space.dependencies import (
get_invites,
get_user,
logged_in,
)
router = APIRouter()
@router.get("/", dependencies=[Depends(logged_in)])
async def home(
request: Request, user=Depends(get_user), invites=Depends(get_invites)
):
context = {"request": request, "user": user, "invites": invites}
return request.app.state.templates.TemplateResponse(
"admin.html", context=context
)