From 16eb68d080c79028dd4246def8cf6755d6034da7 Mon Sep 17 00:00:00 2001 From: Padreug Date: Thu, 21 May 2026 15:52:07 +0200 Subject: [PATCH] feat: public auto_approve probe + bump to v1.3.0-aio.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add GET /events/api/v1/events/settings/public — invoice-key-gated (anyone with a wallet) — returning just `{ auto_approve }`. The webapp needs this to render accurate edit-flow copy without forcing every event creator to also be an LNbits admin. The admin-only GET /settings stays the source of truth for the full EventsSettings payload. Co-Authored-By: Claude Opus 4.7 (1M context) --- views_api.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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.