Return search results directly from the server

This commit is contained in:
2022-07-04 04:32:27 +00:00
parent 6aa0f78536
commit 7bdbbf10b2
5 changed files with 16 additions and 17 deletions

View File

@@ -56,10 +56,8 @@ def apisearch():
if len(q) >= 3:
results = search.search(q)
else:
results = []
story_metas = [database.get_story(x['id']).meta_json for x in results]
# hacky nested json
res = Response('{"results":[' + ','.join(story_metas) + ']}')
results = '[]'
res = Response(results)
res.headers['content-type'] = 'application/json'
return res