feat: public auto_approve probe + bump to v1.3.0-aio.5
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) <noreply@anthropic.com>
This commit is contained in:
parent
0dc2dcc35f
commit
16eb68d080
1 changed files with 13 additions and 0 deletions
13
views_api.py
13
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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue