topic-stat-fix
Some checks failed
Deploy on push / deploy (push) Failing after 6s

This commit is contained in:
2024-04-09 19:38:02 +03:00
parent 4fe15d1440
commit c6a4f04779
2 changed files with 36 additions and 39 deletions

View File

@@ -49,9 +49,10 @@ async def get_topics_by_author(_, _info, author_id=0, slug='', user=''):
@query.field('get_topic')
def get_topic(_, _info, slug: str):
q = select(Topic).filter(Topic.slug == slug)
topics = get_with_stat(q)
if topics:
return topics[0]
result = get_with_stat(q)
if result:
[topic] = result
return topic
@mutation.field('create_topic')