shoutsSubscribed return published and unpublished shouts
This commit is contained in:
parent
03c1b69bfb
commit
f89cb47daf
|
@ -446,13 +446,13 @@ async def shouts_subscribed(_, info, page, size):
|
||||||
shouts_by_topic = session.query(Shout).\
|
shouts_by_topic = session.query(Shout).\
|
||||||
join(ShoutTopic).\
|
join(ShoutTopic).\
|
||||||
join(TopicSubscription, ShoutTopic.topic == TopicSubscription.topic).\
|
join(TopicSubscription, ShoutTopic.topic == TopicSubscription.topic).\
|
||||||
where(and_(Shout.publishedAt != None, TopicSubscription.subscriber == user.slug))
|
where(TopicSubscription.subscriber == user.slug)
|
||||||
shouts_by_author = session.query(Shout).\
|
shouts_by_author = session.query(Shout).\
|
||||||
join(ShoutAuthor).\
|
join(ShoutAuthor).\
|
||||||
join(AuthorSubscription, ShoutAuthor.user == AuthorSubscription.author).\
|
join(AuthorSubscription, ShoutAuthor.user == AuthorSubscription.author).\
|
||||||
where(and_(Shout.publishedAt != None, AuthorSubscription.subscriber == user.slug))
|
where(AuthorSubscription.subscriber == user.slug)
|
||||||
shouts = shouts_by_topic.union(shouts_by_author).\
|
shouts = shouts_by_topic.union(shouts_by_author).\
|
||||||
order_by(desc(Shout.publishedAt)).\
|
order_by(desc(Shout.createdAt)).\
|
||||||
limit(size).\
|
limit(size).\
|
||||||
offset( (page - 1) * size)
|
offset( (page - 1) * size)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user