unique-reactions
All checks were successful
Deploy to core / deploy (push) Successful in 1m39s

This commit is contained in:
Untone 2024-01-31 01:53:54 +03:00
parent fceb3b61c7
commit 880e295b45

View File

@ -415,7 +415,7 @@ async def load_reactions_by(_, info, by, limit=50, offset=0):
# pagination # pagination
q = q.limit(limit).offset(offset) q = q.limit(limit).offset(offset)
reactions = [] reactions = set()
with local_session() as session: with local_session() as session:
result_rows = session.execute(q) result_rows = session.execute(q)
for [ for [
@ -435,7 +435,7 @@ async def load_reactions_by(_, info, by, limit=50, offset=0):
'reacted': reacted_stat, 'reacted': reacted_stat,
'commented': commented_stat, 'commented': commented_stat,
} }
reactions.append(reaction) reactions.add(reaction)
# sort if by stat is present # sort if by stat is present
stat_sort = by.get('stat') stat_sort = by.get('stat')