gourami

[UNMAINTAINED] Activitypub server in Rust
Log | Files | Refs | README | LICENSE

commit e3bb34951c941d83b417a19642d909819b2256b2
parent 161fcb39ac47625dba2792a874862c3cfec66f5c
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Fri, 24 Apr 2020 00:43:33 -0500

Order user notes by id descending

Diffstat:
Msrc/lib.rs | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib.rs b/src/lib.rs @@ -325,7 +325,6 @@ fn note_page(session: Option<Session>, note_id: i32) -> impl Reply { fn user_page(session: Option<Session>, user_name: String) -> impl Reply { let global = Global::from_session(session); - use db::schema::notes::dsl::*; use db::schema::users::dsl::*; let conn = &POOL.get().unwrap(); let user: Option<User> = users @@ -333,8 +332,10 @@ fn user_page(session: Option<Session>, user_name: String) -> impl Reply { .first::<User>(conn) .ok(); if let Some(u) = user { + use db::schema::notes::dsl::*; let results = notes .filter(creator_id.eq(u.id)) + .order(id.desc()) .load::<Note>(conn) .expect("Error loading posts"); render_template(&UserTemplate{