get-user-followsx
All checks were successful
Deploy to core / deploy (push) Successful in 1m25s

This commit is contained in:
Untone 2024-02-22 13:07:09 +03:00
parent 0f038ac6d7
commit d9abea9840

View File

@ -86,11 +86,12 @@ async def unfollow(_, info, what, slug):
def query_follows(user_id: str): def query_follows(user_id: str):
topics = [] topics = []
authors = [] authors = []
author_id = None
with local_session() as session: with local_session() as session:
author_id = ( author = (
session.query(Author.id).filter(Author.user == user_id).first() session.query(Author).filter(Author.user == user_id).first()
) )
session.commit() author_id = author.id
if isinstance(author_id, int): if isinstance(author_id, int):
authors_query = ( authors_query = (
select(Author) select(Author)
@ -99,7 +100,7 @@ def query_follows(user_id: str):
) )
authors = [ authors = [
{ {
'id': author.id, 'id': author_id,
'name': author.name, 'name': author.name,
'slug': author.slug, 'slug': author.slug,
'pic': author.pic, 'pic': author.pic,