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
|
||||
|
|
|
|||
|
|
@ -42,9 +42,23 @@
|
|||
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<q-btn unelevated color="primary" @click="openEventDialog"
|
||||
>New Event</q-btn
|
||||
>
|
||||
<div class="row items-center q-gutter-sm">
|
||||
<q-btn unelevated color="primary" @click="openEventDialog"
|
||||
>New Event</q-btn
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
icon="cloud_upload"
|
||||
label="Republish mine"
|
||||
:loading="republishingMine"
|
||||
@click="republishMyEvents"
|
||||
></q-btn>
|
||||
</div>
|
||||
<div class="text-caption q-mt-sm" style="color: #aaa">
|
||||
Re-emit your approved events to Nostr relays. Useful after
|
||||
a publisher upgrade or if a relay dropped your events.
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue