shouts-distinc-topics-authors-fix
Some checks failed
Deploy on push / deploy (push) Failing after 9s

This commit is contained in:
Untone 2024-08-07 13:47:10 +03:00
parent 7e89a3471f
commit 087f6a7157

View File

@ -49,6 +49,7 @@ def query_shouts():
).label("rating_stat"),
func.max(aliased_reaction.created_at).label("last_reacted_at"),
array_agg(
func.distinct(
func.json_build_object(
"id",
Author.id,
@ -59,8 +60,10 @@ def query_shouts():
"pic",
Author.pic,
)
)
).label("authors"),
array_agg(
func.distinct(
func.json_build_object(
"id",
Topic.id,
@ -71,6 +74,7 @@ def query_shouts():
"slug",
Topic.slug,
)
)
).label("topics"),
)
.outerjoin(aliased_reaction, aliased_reaction.shout == Shout.id)