feat: add admin endpoint to view all events across wallets
Some checks failed
lint.yml / feat: add admin endpoint to view all events across wallets (pull_request) Failing after 0s

- GET /api/v1/events/all — returns all events regardless of wallet (admin key)
- Admin UI tries /events/all first, falls back to own wallet events
- Approved events from other users now visible in admin events table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-04-27 11:19:21 +02:00
commit 7843da21d8
2 changed files with 30 additions and 2 deletions

View file

@ -63,6 +63,17 @@ async def api_events_public():
return [event.dict() for event in events]
@events_api_router.get("/api/v1/events/all")
async def api_events_all(
wallet: WalletTypeInfo = Depends(require_admin_key),
):
"""Get all events across all wallets. Admin only."""
from .crud import get_all_events
events = await get_all_events()
return [event.dict() for event in events]
@events_api_router.post("/api/v1/events")
@events_api_router.put("/api/v1/events/{event_id}")
async def api_event_create(