+#[derive(Default)]
+pub struct CommentQuery<'a> {
+ pub listing_type: Option<ListingType>,
+ pub sort: Option<CommentSortType>,
+ pub community_id: Option<CommunityId>,
+ pub post_id: Option<PostId>,
+ pub parent_path: Option<Ltree>,
+ pub creator_id: Option<PersonId>,
+ pub local_user: Option<&'a LocalUserView>,
+ pub search_term: Option<String>,
+ pub saved_only: Option<bool>,
+ pub liked_only: Option<bool>,
+ pub disliked_only: Option<bool>,
+ pub is_profile_view: bool,
+ pub page: Option<i64>,
+ pub limit: Option<i64>,
+ pub max_depth: Option<i32>,
+}
+
+impl<'a> CommentQuery<'a> {
+ pub async fn list(self, pool: &mut DbPool<'_>) -> Result<Vec<CommentView>, Error> {
+ queries().list(pool, self).await