mirror of
https://github.com/lnbits/lnbits.git
synced 2025-03-30 04:32:01 +02:00
Update views_api.py
This commit is contained in:
parent
eb938c11a8
commit
0c88aa8fcf
@ -191,14 +191,21 @@ def api_diagonalleys_order_shipped(order_id):
|
|||||||
return jsonify([order._asdict() for order in get_diagonalleys_orders(order["wallet"])]), Status.OK
|
return jsonify([order._asdict() for order in get_diagonalleys_orders(order["wallet"])]), Status.OK
|
||||||
|
|
||||||
|
|
||||||
###List products based on wallet
|
###List products based on indexer id
|
||||||
|
|
||||||
@diagonalley_ext.route("/api/v1/diagonalley/stall/products/<wallet_id>", methods=["GET"])
|
@diagonalley_ext.route("/api/v1/diagonalley/stall/products/<indexer_id>", methods=["GET"])
|
||||||
def api_diagonalleys_stall_products(wallet_id):
|
def api_diagonalleys_stall_products(indexer_id):
|
||||||
with open_ext_db("diagonalley") as db:
|
with open_ext_db("diagonalley") as db:
|
||||||
rows = db.fetchall("SELECT * FROM products WHERE WALLET = ?", (wallet_id,))
|
rows = db.fetchone("SELECT * FROM indexers WHERE id = ?", (indexer_id,))
|
||||||
|
print(rows[1])
|
||||||
|
if not rows:
|
||||||
|
return jsonify({"message": "Indexer does not exist."}), Status.NOT_FOUND
|
||||||
|
|
||||||
return jsonify([products._asdict() for products in get_diagonalleys_products(wallet_id)]), Status.OK
|
products = db.fetchone("SELECT * FROM products WHERE wallet = ?", (rows[1],))
|
||||||
|
if not products:
|
||||||
|
return jsonify({"message": "No products"}), Status.NOT_FOUND
|
||||||
|
|
||||||
|
return jsonify([products._asdict() for products in get_diagonalleys_products(rows[1])]), Status.OK
|
||||||
|
|
||||||
###Check a product has been shipped
|
###Check a product has been shipped
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user