Skip to content

Commit

Permalink
reduce returned data
Browse files Browse the repository at this point in the history
  • Loading branch information
Sosek1 committed Sep 29, 2024
1 parent e552438 commit 882b08b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,16 @@ def knn_search():
def get_ngos():
uuids = request.args.getlist('uuid')

matched_ngos = [ngo for ngo in json_data if ngo['ID'] in uuids]

matched_ngos = [
{
'ID': ngo['ID'],
'name': ngo['Nazwa Organizacji'],
'location': ngo['Lokacja'],
'bio': ngo['Opis']
}
for ngo in json_data if ngo['ID'] in uuids
]

return jsonify(matched_ngos)


Expand Down

0 comments on commit 882b08b

Please sign in to comment.