From 9e5236c3872443c32e933b2f6d0595e241ece335 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 3 Jul 2021 13:40:26 +0200 Subject: [PATCH] New API method to get details of single item --- web_view.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web_view.py b/web_view.py index ece44d8..e3803a5 100755 --- a/web_view.py +++ b/web_view.py @@ -280,6 +280,18 @@ def api_osm_objects(): return cors_jsonify(success=True, objects=objects, duration=t1) +@app.route("/api/1/item/Q") +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/tags") def api_get_item_tags(item_id): t0 = time()