feat: add merchant profile edit, keys dialog, and publish to Nostr

- Add PATCH endpoint for updating merchant profile config
- Add website field to MerchantProfile model
- Fix to_nostr_event to include all profile fields (display_name, banner, website, nip05, lud16)
- Always publish merchant profile (kind 0) when publishing to Nostr
- Extract edit-profile-dialog and nostr-keys-dialog into separate components
- Fix profile avatar alignment to match original design
- Simplify keys dialog to show only npub QR code (no nsec QR)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ben Weeks 2025-12-24 12:42:03 +00:00
parent c3dea9f01d
commit a21b5289c1
12 changed files with 635 additions and 109 deletions

View file

@ -13,12 +13,41 @@ window.app.component('merchant-tab', {
'is-admin',
'merchant-config'
],
emits: [
'toggle-show-keys',
'hide-keys',
'merchant-deleted',
'toggle-merchant-state',
'restart-nostr-connection',
'profile-updated'
],
data: function () {
return {
showEditProfileDialog: false,
showKeysDialog: false
}
},
computed: {
marketClientUrl: function () {
return '/nostrmarket/market'
}
},
methods: {
publishProfile: async function () {
try {
await LNbits.api.request(
'PUT',
`/nostrmarket/api/v1/merchant/${this.merchantId}/nostr`,
this.adminkey
)
this.$q.notify({
type: 'positive',
message: 'Profile published to Nostr!'
})
} catch (error) {
LNbits.utils.notifyApiError(error)
}
},
toggleShowKeys: function () {
this.$emit('toggle-show-keys')
},
@ -33,6 +62,9 @@ window.app.component('merchant-tab', {
},
restartNostrConnection: function () {
this.$emit('restart-nostr-connection')
},
handleImageError: function (e) {
e.target.style.display = 'none'
}
}
})