diff --git a/src/routes/activitypub/outbox.rs b/src/routes/activitypub/outbox.rs index 9823ff6..77aee70 100644 --- a/src/routes/activitypub/outbox.rs +++ b/src/routes/activitypub/outbox.rs @@ -18,7 +18,7 @@ pub async fn page( match model::addressing::Entity::find_activities() .filter(auth.filter_condition()) // TODO also limit to only local activities - .order_by(model::addressing::Column::Published, Order::Desc) + .order_by(model::addressing::Column::Published, Order::Asc) .limit(limit) .offset(offset) .into_model::() diff --git a/src/routes/activitypub/user/inbox.rs b/src/routes/activitypub/user/inbox.rs index 52b9fc0..4eaf218 100644 --- a/src/routes/activitypub/user/inbox.rs +++ b/src/routes/activitypub/user/inbox.rs @@ -1,6 +1,6 @@ use axum::{extract::{Path, Query, State}, http::StatusCode, Json}; -use sea_orm::{ColumnTrait, Condition, QueryFilter, QuerySelect}; +use sea_orm::{ColumnTrait, Condition, Order, QueryFilter, QueryOrder, QuerySelect}; use crate::{errors::UpubError, model::{self, addressing::EmbeddedActivity}, routes::activitypub::{jsonld::LD, JsonLD, Pagination}, server::{auth::{AuthIdentity, Identity}, Context}, url}; pub async fn get( @@ -34,6 +34,7 @@ pub async fn page( let offset = page.offset.unwrap_or(0); match model::addressing::Entity::find_activities() .filter(Condition::all().add(model::addressing::Column::Actor.eq(&user))) + .order_by(model::addressing::Column::Published, Order::Asc) .offset(offset) .limit(limit) .into_model::() diff --git a/src/routes/activitypub/user/outbox.rs b/src/routes/activitypub/user/outbox.rs index 396553c..c4fe7fd 100644 --- a/src/routes/activitypub/user/outbox.rs +++ b/src/routes/activitypub/user/outbox.rs @@ -26,7 +26,7 @@ pub async fn page( match model::addressing::Entity::find_activities() .filter(Condition::all().add(model::activity::Column::Actor.eq(&uid))) .filter(auth.filter_condition()) - .order_by(model::addressing::Column::Published, Order::Desc) + .order_by(model::addressing::Column::Published, Order::Asc) .limit(limit) .offset(offset) .into_model::()