diff --git a/upub/routes/src/activitypub/object/context.rs b/upub/routes/src/activitypub/object/context.rs index a3d81dc..c9a94c6 100644 --- a/upub/routes/src/activitypub/object/context.rs +++ b/upub/routes/src/activitypub/object/context.rs @@ -1,5 +1,5 @@ use axum::extract::{Path, Query, State}; -use sea_orm::{ColumnTrait, Order, PaginatorTrait, QueryFilter, QueryOrder, QuerySelect}; +use sea_orm::{ColumnTrait, PaginatorTrait, QueryFilter, QueryOrder, QuerySelect}; use upub::{model, selector::{BatchFillable, RichObject}, Context}; use crate::{activitypub::Pagination, builders::JsonLD, AuthIdentity}; @@ -33,7 +33,7 @@ pub async fn page( .filter(auth.filter_objects()) .filter(model::object::Column::Context.eq(context)) // note that this should be ASC so we get replies somewhat ordered - .order_by(model::object::Column::Published, Order::Asc) + .order_by_asc(model::object::Column::Published) .limit(limit) .offset(offset) .into_model::() diff --git a/upub/routes/src/activitypub/object/replies.rs b/upub/routes/src/activitypub/object/replies.rs index 47c34e0..d1d1ca1 100644 --- a/upub/routes/src/activitypub/object/replies.rs +++ b/upub/routes/src/activitypub/object/replies.rs @@ -1,6 +1,6 @@ use apb::{BaseMut, CollectionMut, LD}; use axum::extract::{Path, Query, State}; -use sea_orm::{ColumnTrait, PaginatorTrait, QueryFilter, QuerySelect}; +use sea_orm::{ColumnTrait, PaginatorTrait, QueryFilter, QueryOrder, QuerySelect}; use upub::{model, selector::RichObject, traits::Fetcher, Context}; use crate::{activitypub::{Pagination, TryFetch}, builders::JsonLD, AuthIdentity}; @@ -55,6 +55,7 @@ pub async fn page( .offset(offset) .filter(auth.filter_objects()) .filter(model::object::Column::InReplyTo.eq(oid)) + .order_by_desc(model::object::Column::Published) .into_model::() .all(ctx.db()) .await?