feat: handle stall delete and update

This commit is contained in:
Vlad Stan 2023-03-02 14:37:07 +02:00
parent 5a526f86f1
commit f22e47e9ce
4 changed files with 22 additions and 12 deletions

View file

@ -91,7 +91,7 @@
unelevated
color="secondary"
class="float-left"
@click="updateRelay()"
@click="updateStall()"
>Update Stall</q-btn
>
</div>
@ -101,7 +101,7 @@
color="pink"
icon="cancel"
class="float-right"
@click="deleteRelay()"
@click="deleteStall()"
>Delete Stall</q-btn
>
</div>

View file

@ -27,7 +27,7 @@ async function stallDetails(path) {
}
},
methods: {
mapStall: function(stall) {
mapStall: function (stall) {
stall.shipping_zones.forEach(
z =>
(z.label = z.name
@ -44,13 +44,13 @@ async function stallDetails(path) {
this.inkey
)
this.stall = this.mapStall(data)
console.log('### this.stall', this.stall)
} catch (error) {
LNbits.utils.notifyApiError(error)
}
},
updateRelay: async function () {
updateStall: async function () {
try {
const {data} = await LNbits.api.request(
'PUT',
@ -70,7 +70,7 @@ async function stallDetails(path) {
LNbits.utils.notifyApiError(error)
}
},
deleteRelay: function () {
deleteStall: function () {
LNbits.utils
.confirmDialog(
`
@ -96,7 +96,7 @@ async function stallDetails(path) {
LNbits.utils.notifyApiError(error)
}
})
},
}
},
created: async function () {
await this.getStall()