feat: organizer-side "Republish mine" button + scoped endpoint
The admin /republish-all hits every approved event regardless of owner — useful for the catalog migration, but heavy. Organizers who want to re-emit just THEIR own events (e.g. after the AIO publisher gained the tickets_* tags and an organizer's events should pick them up) need a lighter knob. Backend: new POST /republish-mine wallet-scoped via require_admin_key, mirrors api_tickets's `all_wallets=true` shape so the page can re-emit across every wallet the user owns. Filters to approved + non-canceled rows. UI: "Republish mine" button alongside "New Event" so every logged-in user sees it (no isAdmin gate). Loading state + confirm dialog + success count notification. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fa2a6e40f0
commit
ced6ca2b2b
3 changed files with 79 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ window.PageEvents = {
|
|||
allUserEvents: [],
|
||||
isAdmin: false,
|
||||
republishing: false,
|
||||
republishingMine: false,
|
||||
settings: {
|
||||
auto_approve: false
|
||||
},
|
||||
|
|
@ -303,6 +304,36 @@ window.PageEvents = {
|
|||
})
|
||||
})
|
||||
},
|
||||
republishMyEvents() {
|
||||
LNbits.utils
|
||||
.confirmDialog(
|
||||
'Re-emit your approved events to Nostr relays?'
|
||||
)
|
||||
.onOk(() => {
|
||||
this.republishingMine = true
|
||||
LNbits.api
|
||||
.request(
|
||||
'POST',
|
||||
'/events/api/v1/events/republish-mine?all_wallets=true',
|
||||
this.g.user.wallets[0].adminkey
|
||||
)
|
||||
.then(response => {
|
||||
Quasar.Notify.create({
|
||||
type: 'positive',
|
||||
message:
|
||||
'Republished ' +
|
||||
response.data.republished +
|
||||
' of your ' +
|
||||
response.data.total +
|
||||
' events'
|
||||
})
|
||||
})
|
||||
.catch(LNbits.utils.notifyApiError)
|
||||
.finally(() => {
|
||||
this.republishingMine = false
|
||||
})
|
||||
})
|
||||
},
|
||||
foldDateTime(day, time) {
|
||||
// Combine separate date/time inputs into the wire format
|
||||
// expected by the events extension: "YYYY-MM-DD" or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue