feat: allow invoice re-issue
This commit is contained in:
parent
4539e3a515
commit
b5aed1224a
4 changed files with 110 additions and 10 deletions
|
|
@ -156,7 +156,16 @@
|
|||
<div class="col-6 col-sm-8 q-pr-lg">
|
||||
<q-input filled dense readonly disabled v-model.trim="props.row.invoice_id" type="text"></q-input>
|
||||
</div>
|
||||
<div class="col-3 col-sm-1"></div>
|
||||
<div class="col-3">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row items-center no-wrap q-mb-md">
|
||||
<div class="col-3 q-pr-lg"></div>
|
||||
|
||||
<div class="col-9">
|
||||
<q-btn @click="reissueOrderInvoice(props.row.id)" unelevated color="primary" type="submit" class="float-left" label="Reissue Invoice"></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
|
|||
|
|
@ -205,6 +205,27 @@ async function orderList(path) {
|
|||
this.search.restoring = false
|
||||
}
|
||||
},
|
||||
reissueOrderInvoice: async function (orderId) {
|
||||
try {
|
||||
const { data } = await LNbits.api.request(
|
||||
'PUT',
|
||||
`/nostrmarket/api/v1/order/${orderId}/reissue`,
|
||||
this.adminkey
|
||||
)
|
||||
this.$q.notify({
|
||||
type: 'positive',
|
||||
message: 'Order invoice reissued!'
|
||||
})
|
||||
|
||||
const i = this.orders.map(o => o.id).indexOf(orderId)
|
||||
console.log('### order', i)
|
||||
if (i !== -1) {
|
||||
this.orders[i] = { ...this.orders[i], ...data}
|
||||
}
|
||||
} catch (error) {
|
||||
LNbits.utils.notifyApiError(error)
|
||||
}
|
||||
},
|
||||
updateOrderShipped: async function () {
|
||||
this.selectedOrder.shipped = !this.selectedOrder.shipped
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue