toggle shipped
This commit is contained in:
parent
301cfb25d9
commit
77051d2609
2 changed files with 5 additions and 3 deletions
|
|
@ -1194,10 +1194,12 @@
|
|||
})
|
||||
},
|
||||
shipOrder(order_id) {
|
||||
let shipped = this.orders.find(o => o.id == order_id).shipped
|
||||
console.log(this.orders, order_id, shipped)
|
||||
LNbits.api
|
||||
.request(
|
||||
'GET',
|
||||
'/shop/api/v1/orders/shipped/' + order_id,
|
||||
`/shop/api/v1/orders/shipped/${order_id}?shipped=${!shipped}`,
|
||||
this.g.user.wallets[0].inkey
|
||||
)
|
||||
.then(response => {
|
||||
|
|
|
|||
|
|
@ -358,12 +358,12 @@ async def api_shop_order_pubkey(payment_hash: str, pubkey: str):
|
|||
|
||||
@shop_ext.get("/api/v1/orders/shipped/{order_id}")
|
||||
async def api_shop_order_shipped(
|
||||
order_id, wallet: WalletTypeInfo = Depends(get_key_type)
|
||||
order_id, shipped: bool = Query(...), wallet: WalletTypeInfo = Depends(get_key_type)
|
||||
):
|
||||
await db.execute(
|
||||
"UPDATE shop.orders SET shipped = ? WHERE id = ?",
|
||||
(
|
||||
True,
|
||||
shipped,
|
||||
order_id,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue