toggle shipped
This commit is contained in:
@@ -1194,10 +1194,12 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
shipOrder(order_id) {
|
shipOrder(order_id) {
|
||||||
|
let shipped = this.orders.find(o => o.id == order_id).shipped
|
||||||
|
console.log(this.orders, order_id, shipped)
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.request(
|
.request(
|
||||||
'GET',
|
'GET',
|
||||||
'/shop/api/v1/orders/shipped/' + order_id,
|
`/shop/api/v1/orders/shipped/${order_id}?shipped=${!shipped}`,
|
||||||
this.g.user.wallets[0].inkey
|
this.g.user.wallets[0].inkey
|
||||||
)
|
)
|
||||||
.then(response => {
|
.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}")
|
@shop_ext.get("/api/v1/orders/shipped/{order_id}")
|
||||||
async def api_shop_order_shipped(
|
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(
|
await db.execute(
|
||||||
"UPDATE shop.orders SET shipped = ? WHERE id = ?",
|
"UPDATE shop.orders SET shipped = ? WHERE id = ?",
|
||||||
(
|
(
|
||||||
True,
|
shipped,
|
||||||
order_id,
|
order_id,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user