pub fn read(conn: &PgConnection, report_id: i32) -> Result<Self, Error> {
use super::comment_report::comment_report_view::dsl::*;
comment_report_view
- .filter(id.eq(report_id))
+ .find(report_id)
.first::<Self>(conn)
}
}
let (limit, offset) = limit_and_offset(self.page, self.limit);
query
- .order_by(published.desc())
+ .order_by(published.asc())
.limit(limit)
.offset(offset)
.load::<CommentReportView>(self.conn)
pub fn read(conn: &PgConnection, report_id: i32) -> Result<Self, Error> {
use super::post_report::post_report_view::dsl::*;
post_report_view
- .filter(id.eq(report_id))
+ .find(report_id)
.first::<Self>(conn)
}
}
let (limit, offset) = limit_and_offset(self.page, self.limit);
query
- .order_by(published.desc())
+ .order_by(published.asc())
.limit(limit)
.offset(offset)
.load::<PostReportView>(self.conn)