diff --git a/views_api.py b/views_api.py index afea116..36a444b 100644 --- a/views_api.py +++ b/views_api.py @@ -125,6 +125,19 @@ async def api_update_settings( return await update_settings(data) +@events_api_router.get("/settings/public") +async def api_get_settings_public( + wallet: WalletTypeInfo = Depends(require_invoice_key), +) -> dict: + """Subset of EventsSettings safe to expose to any authenticated + caller. The webapp needs `auto_approve` to render accurate edit-flow + copy ("your edit will go back to pending" vs "edit stays approved") + without forcing every event-creator to also be an LNbits admin. + """ + settings = await get_settings() + return {"auto_approve": settings.auto_approve} + + @events_api_router.get("/{event_id}", response_model=PublicEvent) async def api_get_event(event_id: str) -> Event: """Public event detail used by display.vue.