db: fix a few comments i missed
This commit is contained in:
parent
d6b1c8df2f
commit
e8e0890341
2 changed files with 4 additions and 4 deletions
|
@ -110,7 +110,7 @@ impl CommentReportView {
|
||||||
pub fn read(conn: &PgConnection, report_id: i32) -> Result<Self, Error> {
|
pub fn read(conn: &PgConnection, report_id: i32) -> Result<Self, Error> {
|
||||||
use super::comment_report::comment_report_view::dsl::*;
|
use super::comment_report::comment_report_view::dsl::*;
|
||||||
comment_report_view
|
comment_report_view
|
||||||
.filter(id.eq(report_id))
|
.find(report_id)
|
||||||
.first::<Self>(conn)
|
.first::<Self>(conn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ impl<'a> CommentReportQueryBuilder<'a> {
|
||||||
let (limit, offset) = limit_and_offset(self.page, self.limit);
|
let (limit, offset) = limit_and_offset(self.page, self.limit);
|
||||||
|
|
||||||
query
|
query
|
||||||
.order_by(published.desc())
|
.order_by(published.asc())
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
.load::<CommentReportView>(self.conn)
|
.load::<CommentReportView>(self.conn)
|
||||||
|
|
|
@ -107,7 +107,7 @@ impl PostReportView {
|
||||||
pub fn read(conn: &PgConnection, report_id: i32) -> Result<Self, Error> {
|
pub fn read(conn: &PgConnection, report_id: i32) -> Result<Self, Error> {
|
||||||
use super::post_report::post_report_view::dsl::*;
|
use super::post_report::post_report_view::dsl::*;
|
||||||
post_report_view
|
post_report_view
|
||||||
.filter(id.eq(report_id))
|
.find(report_id)
|
||||||
.first::<Self>(conn)
|
.first::<Self>(conn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ impl<'a> PostReportQueryBuilder<'a> {
|
||||||
let (limit, offset) = limit_and_offset(self.page, self.limit);
|
let (limit, offset) = limit_and_offset(self.page, self.limit);
|
||||||
|
|
||||||
query
|
query
|
||||||
.order_by(published.desc())
|
.order_by(published.asc())
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset)
|
.offset(offset)
|
||||||
.load::<PostReportView>(self.conn)
|
.load::<PostReportView>(self.conn)
|
||||||
|
|
Loading…
Reference in a new issue