add authors and subscriptions in Topic stat

This commit is contained in:
knst-kotov
2021-12-15 12:17:16 +03:00
parent 01a974e974
commit a98d5f6ee6
4 changed files with 28 additions and 17 deletions

View File

@@ -32,17 +32,6 @@ async def topics_by_author(_, info, author):
slugs.update([topic.slug for topic in shout.topics])
return await TopicStorage.get_topics(slugs)
@query.field("getTopicAuthors")
async def topics_by_author(_, info, slug, count, page):
shouts = await TopicStat.get_shouts(slug)
authors = set()
for shout in shouts:
authors.update(await ShoutAuthorStorage.get_authors(shout))
authors = list(authors)
authors.sort() #TODO sort by username
authors = authors[count * page : count * (page + 1) ]
return [await UserStorage.get_user(author) for author in authors]
@mutation.field("createTopic")
@login_required
async def create_topic(_, info, input):