This commit is contained in:
parent
9416165699
commit
882ef0288a
|
@ -225,8 +225,8 @@ def get_shouts_with_stats(q, limit=20, offset=0, author_id=None):
|
|||
func.count(distinct(Reaction.id)).label("comments_stat"),
|
||||
func.sum(
|
||||
case(
|
||||
[(Reaction.kind == "LIKE", 1),
|
||||
(Reaction.kind == "DISLIKE", -1)],
|
||||
(Reaction.kind == ReactionKind.LIKE.value, 1),
|
||||
(Reaction.kind == ReactionKind.DISLIKE.value, -1),
|
||||
else_=0
|
||||
)
|
||||
).label("rating_stat"),
|
||||
|
|
Loading…
Reference in New Issue
Block a user