logs-fix
All checks were successful
deploy / deploy (push) Successful in 2m5s

This commit is contained in:
2023-11-24 04:53:30 +03:00
parent 167eed436d
commit 4e7250acef
5 changed files with 21 additions and 23 deletions

View File

@@ -138,12 +138,18 @@ async def get_authors_all(_, _info):
@query.field("getAuthor")
async def get_author(_, _info, slug):
q = select(Author).where(Author.slug == slug)
q = add_author_stat_columns(q)
async def get_author(_, _info, slug="", user=None, author=None):
if slug or user or author:
if slug:
q = select(Author).where(Author.slug == slug)
elif user:
q = select(Author).where(Author.user == user)
elif author:
q = select(Author).where(Author.id == author)
q = add_author_stat_columns(q)
authors = get_authors_from_query(q)
return authors[0]
authors = get_authors_from_query(q)
return authors[0]
@query.field("loadAuthorsBy")