authorsAll fix

This commit is contained in:
Igor Lobanov 2022-09-29 19:35:04 +02:00
parent 9ab99d9147
commit e21590e206

View File

@ -184,9 +184,11 @@ def author_unfollow(user, slug):
@query.field("authorsAll")
def get_authors_all(_, _info, offset, limit):
return list(UserStorage.get_all_users())[offset : offset + limit] # type: ignore
def get_authors_all(_, _info):
authors = await UserStorage.get_all_users()
for author in authors:
author.stat = await get_author_stat(author.slug)
return authors
@query.field("topAuthors")
def get_top_authors(_, _info, offset, limit):