New API method to get details of single item

This commit is contained in:
Edward Betts 2021-07-03 13:40:26 +02:00
parent 22cfe64896
commit 9e5236c387

View file

@ -280,6 +280,18 @@ def api_osm_objects():
return cors_jsonify(success=True, objects=objects, duration=t1)
@app.route("/api/1/item/Q<int:item_id>")
def api_get_item(item_id):
t0 = time()
item = model.Item.query.get(item_id)
detail = api.item_detail(item)
t1 = time() - t0
return cors_jsonify(success=True,
duration=t1,
**detail)
@app.route("/api/1/item/Q<int:item_id>/tags")
def api_get_item_tags(item_id):
t0 = time()