Improve search API output

This commit is contained in:
Edward Betts 2021-07-08 14:35:32 +02:00
parent 4ebe992919
commit c4f284031c
1 changed files with 2 additions and 0 deletions

View File

@ -364,6 +364,8 @@ def api_search():
if "geotext" in hit:
del hit["geotext"]
hit["name"] = nominatim.get_hit_name(hit)
hit["label"] = nominatim.get_hit_label(hit)
hit["address"] = list(hit["address"].items())
hit["identifier"] = f"{hit['osm_type']}/{hit['osm_id']}"
return cors_jsonify(success=True, hits=hits)