+ .left_join(
+ comment_like::table.on(
+ comment::id
+ .eq(comment_like::comment_id)
+ .and(comment_like::person_id.eq(my_person_id)),
+ ),
+ )
+ .left_join(
+ aliases::person2
+ .on(comment_report::resolver_id.eq(aliases::person2.field(person::id).nullable())),
+ )
+ };
+
+ let selection = (
+ comment_report::all_columns,
+ comment::all_columns,
+ post::all_columns,
+ community::all_columns,
+ person::all_columns,
+ aliases::person1.fields(person::all_columns),
+ comment_aggregates::all_columns,
+ community_person_ban::id.nullable().is_not_null(),
+ comment_like::score.nullable(),
+ aliases::person2.fields(person::all_columns).nullable(),
+ );
+
+ let read = move |mut conn: DbConn<'a>, (report_id, my_person_id): (CommentReportId, PersonId)| async move {
+ all_joins(
+ comment_report::table.find(report_id).into_boxed(),
+ my_person_id,
+ )
+ .left_join(
+ community_person_ban::table.on(
+ community::id
+ .eq(community_person_ban::community_id)
+ .and(community_person_ban::person_id.eq(comment::creator_id)),
+ ),
+ )
+ .select(selection)
+ .first::<<CommentReportView as JoinView>::JoinTuple>(&mut conn)
+ .await
+ };
+
+ let list = move |mut conn: DbConn<'a>, (options, my_person): (CommentReportQuery, &'a Person)| async move {
+ let mut query = all_joins(comment_report::table.into_boxed(), my_person.id)