forked from alemi/upub
fix: timelines ordering
what??? ASCENDING goes from most recent to least recent?? maybe ascending oldness??????
This commit is contained in:
parent
d3d5f98dfd
commit
576e809b69
3 changed files with 4 additions and 3 deletions
|
@ -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::<EmbeddedActivity>()
|
||||
|
|
|
@ -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::<EmbeddedActivity>()
|
||||
|
|
|
@ -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::<EmbeddedActivity>()
|
||||
|
|
Loading…
Reference in a new issue