feat: add optional domain field (#120)
* feat: add optional domain field closes #119
This commit is contained in:
parent
76c5841bc8
commit
17135b45ae
8 changed files with 107 additions and 46 deletions
|
|
@ -2,10 +2,26 @@ window.PageLnurlpPublic = {
|
|||
template: '#page-lnurlp-public',
|
||||
data() {
|
||||
return {
|
||||
url: ''
|
||||
url: '',
|
||||
payLink: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setUrl(link_id, domain) {
|
||||
this.url = `https://${domain || window.location.host}/lnurlp/${link_id}`
|
||||
},
|
||||
getPayLink() {
|
||||
this.api
|
||||
.request('GET', `/lnurlp/api/v1/links/public/${this.$route.params.id}`)
|
||||
.then(res => {
|
||||
this.payLink = res.data
|
||||
this.setUrl(this.payLink.id, this.payLink.domain)
|
||||
})
|
||||
.catch(this.utils.notifyApiError)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.url = window.location.origin + '/lnurlp/' + this.$route.params.id
|
||||
this.setUrl(this.$route.params.id)
|
||||
this.getPayLink()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue