members.lumbung.space/members_lumbung_space/routes/resource.py

17 lines
486 B
Python
Raw Normal View History

2022-01-10 15:31:09 +00:00
"""Resource map routes."""
from fastapi import APIRouter, Depends, Request
from fastapi.responses import RedirectResponse
from members_lumbung_space.dependencies import logged_in
router = APIRouter()
@router.get("/resource/generate", dependencies=[Depends(logged_in)])
async def generate_resource_map(request: Request):
from members_lumbung_space.nextcloud import init_resource_map
await init_resource_map(request.app)
return RedirectResponse(request.url_for("home"))