diff --git a/lnbits/extensions/shop/templates/shop/index.html b/lnbits/extensions/shop/templates/shop/index.html index acb1e5a3..5c02677d 100644 --- a/lnbits/extensions/shop/templates/shop/index.html +++ b/lnbits/extensions/shop/templates/shop/index.html @@ -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 => { diff --git a/lnbits/extensions/shop/views_api.py b/lnbits/extensions/shop/views_api.py index a85d1618..41e0ca88 100644 --- a/lnbits/extensions/shop/views_api.py +++ b/lnbits/extensions/shop/views_api.py @@ -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, ), )