poestmerge
All checks were successful
Deploy on push / deploy (push) Successful in 27s

This commit is contained in:
2024-05-30 12:49:46 +03:00
17 changed files with 168 additions and 431 deletions

View File

@@ -40,17 +40,11 @@ def get_topics_by_community(_, _info, community_id: int):
async def get_topics_by_author(_, _info, author_id=0, slug="", user=""):
topics_by_author_query = select(Topic)
if author_id:
topics_by_author_query = topics_by_author_query.join(Author).where(
Author.id == author_id
)
topics_by_author_query = topics_by_author_query.join(Author).where(Author.id == author_id)
elif slug:
topics_by_author_query = topics_by_author_query.join(Author).where(
Author.slug == slug
)
topics_by_author_query = topics_by_author_query.join(Author).where(Author.slug == slug)
elif user:
topics_by_author_query = topics_by_author_query.join(Author).where(
Author.user == user
)
topics_by_author_query = topics_by_author_query.join(Author).where(Author.user == user)
return get_with_stat(topics_by_author_query)