don't feature hidden/deleted blog posts in user activity
parent
98a98f72ef
commit
fc6d36a790
|
@ -58,8 +58,9 @@ final class ActivityReadApi(
|
|||
}
|
||||
ublogPosts <- a.ublogPosts ?? { p =>
|
||||
ublogApi
|
||||
.lightsByIds(p.value.map(_.value).map(UblogPost.Id))
|
||||
.mon(_.user segment "activity.ublogs") dmap some
|
||||
.liveLightsByIds(p.value.map(_.value).map(UblogPost.Id))
|
||||
.mon(_.user segment "activity.ublogs")
|
||||
.dmap(_.some.filter(_.nonEmpty))
|
||||
}
|
||||
practice = (for {
|
||||
p <- a.practice
|
||||
|
|
|
@ -89,9 +89,9 @@ final class UblogApi(
|
|||
)
|
||||
}
|
||||
|
||||
def lightsByIds(ids: List[UblogPost.Id]): Fu[List[UblogPost.LightPost]] =
|
||||
def liveLightsByIds(ids: List[UblogPost.Id]): Fu[List[UblogPost.LightPost]] =
|
||||
coll
|
||||
.find($inIds(ids), lightPostProjection.some)
|
||||
.find($inIds(ids) ++ $doc("live" -> true), lightPostProjection.some)
|
||||
.cursor[UblogPost.LightPost]()
|
||||
.list()
|
||||
|
||||
|
|
Loading…
Reference in New Issue