Fix API regressions and refresh project docs
This commit is contained in:
@@ -8,6 +8,10 @@ from app.api.deps import require_admin
|
||||
router = APIRouter(dependencies=[Depends(require_admin)])
|
||||
|
||||
|
||||
def _is_summary_command_event(action: str) -> bool:
|
||||
return not action.endswith("_requested")
|
||||
|
||||
|
||||
@router.get("/summary")
|
||||
async def get_summary(days: int = Query(default=7, ge=1, le=365)):
|
||||
"""
|
||||
@@ -33,6 +37,9 @@ async def get_summary(days: int = Query(default=7, ge=1, le=365)):
|
||||
last_on = {}
|
||||
|
||||
for ev in events:
|
||||
if not _is_summary_command_event(ev.action):
|
||||
continue
|
||||
|
||||
tid = ev.target_id
|
||||
if tid not in stats:
|
||||
stats[tid] = {
|
||||
|
||||
Reference in New Issue
Block a user