post::{Post, PostRead, PostSaved},
},
CommunityId,
+ DbUrl,
PersonId,
PostId,
};
sort: Option<SortType>,
creator_id: Option<PersonId>,
community_id: Option<CommunityId>,
- community_name: Option<String>,
+ community_actor_id: Option<DbUrl>,
my_person_id: Option<PersonId>,
search_term: Option<String>,
url_search: Option<String>,
sort: None,
creator_id: None,
community_id: None,
- community_name: None,
+ community_actor_id: None,
my_person_id: None,
search_term: None,
url_search: None,
self
}
- pub fn community_name<T: MaybeOptional<String>>(mut self, community_name: T) -> Self {
- self.community_name = community_name.get_optional();
+ pub fn community_actor_id<T: MaybeOptional<DbUrl>>(mut self, community_actor_id: T) -> Self {
+ self.community_actor_id = community_actor_id.get_optional();
self
}
.then_order_by(post_aggregates::stickied.desc());
}
- if let Some(community_name) = self.community_name {
+ if let Some(community_actor_id) = self.community_actor_id {
query = query
- .filter(community::name.eq(community_name))
- .filter(community::local.eq(true))
+ .filter(community::actor_id.eq(community_actor_id))
.then_order_by(post_aggregates::stickied.desc());
}