]> Untitled Git - lemmy.git/commitdiff
db: fix a few comments i missed
authoreiknat <eiknat@protonmail.com>
Wed, 21 Oct 2020 01:37:37 +0000 (21:37 -0400)
committereiknat <eiknat@dev.chapo.chat>
Wed, 11 Nov 2020 20:11:52 +0000 (15:11 -0500)
lemmy_db/src/comment_report.rs
lemmy_db/src/post_report.rs

index 0725256c2d60952d922e6a2ff0d5c5e2748cae15..2002f66e26aaffe82feffc2d1a6fa18b60a6e5c4 100644 (file)
@@ -110,7 +110,7 @@ impl CommentReportView {
   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)
   }
 }
@@ -167,7 +167,7 @@ impl<'a> CommentReportQueryBuilder<'a> {
     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)
index d461797c170e07bce9437ba78cafb5fe4270b6b8..3a2fc156558dc6dd1eba5cc00bb379a0259c97e4 100644 (file)
@@ -107,7 +107,7 @@ impl PostReportView {
     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)
     }
 }
@@ -173,7 +173,7 @@ impl<'a> PostReportQueryBuilder<'a> {
         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)