This commit is contained in:
@@ -297,8 +297,15 @@ async def load_shouts_feed(_, info, options):
|
||||
async def load_shouts_search(_, _info, text, limit=50, offset=0):
|
||||
if isinstance(text, str) and len(text) > 2:
|
||||
results = await search_text(text, limit, offset)
|
||||
logger.debug(results)
|
||||
return results
|
||||
shouts_ids = []
|
||||
for sr in results:
|
||||
shout_id = sr.get("id")
|
||||
if shout_id:
|
||||
shouts_ids.append(int(shout_id))
|
||||
shouts = []
|
||||
with local_session() as session:
|
||||
shouts = session.query(Shout).filter(Shout.id.in_(shouts_ids)).all()
|
||||
return shouts
|
||||
return []
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user