feat: save relay info updates

This commit is contained in:
Vlad Stan 2023-02-07 14:57:32 +02:00
parent c05ecb054d
commit a74cf42feb
3 changed files with 32 additions and 1 deletions

View file

@ -36,6 +36,11 @@ async function relayDetails(path) {
this.adminkey
)
this.$emit('relay-deleted', this.relayId)
this.$q.notify({
type: 'positive',
message: 'Relay Deleted',
timeout: 5000
})
} catch (error) {
console.warn(error)
LNbits.utils.notifyApiError(error)
@ -53,6 +58,25 @@ async function relayDetails(path) {
} catch (error) {
LNbits.utils.notifyApiError(error)
}
},
updateRelay: async function () {
try {
const {data} = await LNbits.api.request(
'PUT',
'/nostrrelay/api/v1/relay/' + this.relayId,
this.adminkey,
this.relay
)
this.relay = data
this.$emit('relay-updated', this.relay)
this.$q.notify({
type: 'positive',
message: 'Relay Updated',
timeout: 5000
})
} catch (error) {
LNbits.utils.notifyApiError(error)
}
}
},