Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inventory/inventory/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ def __init__(self, id, name, image):

@app.route('/inventory', methods=['GET'])
def get_inventory():
resp = Response(jsonify([item.__dict__ for item in inventory_items]))
resp = jsonify([item.__dict__ for item in inventory_items])
resp.headers.add("odigos-special-header", "inventory-service")
logging.info("Returning inventory")
return resp

@app.route('/buy', methods=['POST'])
def buy_product():
product_id = request.args.get('id', type=int)
resp = Response(jsonify({"message": "Product purchased successfully"}))
resp = jsonify({"message": "Product purchased successfully"})
resp.headers.add("odigos-special-header", "inventory-service")
logging.info(f"Buying product with id {product_id}")
time.sleep(1)
Expand Down
Loading