notopicid
All checks were successful
Deploy on push / deploy (push) Successful in 27s

This commit is contained in:
Untone 2024-05-18 19:30:25 +03:00
parent b73cce5431
commit 71c2e8ea13
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@ import json
import time
from typing import List
from sqlalchemy import or_, select
from sqlalchemy import select
from sqlalchemy.sql import and_
from orm.author import Author, AuthorFollower
@ -289,12 +289,12 @@ def author_unfollow(follower_id, slug):
@query.field("get_topic_followers")
async def get_topic_followers(_, _info, slug: str, topic_id: int) -> List[Author]:
async def get_topic_followers(_, _info, slug: str) -> List[Author]:
topic_followers_query = select(Author)
topic_followers_query = (
topic_followers_query.join(TopicFollower, TopicFollower.follower == Author.id)
.join(Topic, Topic.id == TopicFollower.topic)
.filter(or_(Topic.slug == slug, Topic.id == topic_id))
.filter(Topic.slug == slug)
)
return get_with_stat(topic_followers_query)

View File

@ -12,7 +12,7 @@ type Query {
# follower
get_shout_followers(slug: String, shout_id: Int): [Author]
get_topic_followers(slug: String, topic_id: Int): [Author]
get_topic_followers(slug: String): [Author]
get_author_followers(slug: String, user: String, author_id: Int): [Author]
get_author_follows(slug: String, user: String, author_id: Int): CommonResult!
get_author_follows_topics(slug: String, user: String, author_id: Int): [Topic]