1
0
Fork 0
forked from alemi/upub

fix: timelines ordering

what??? ASCENDING goes from most recent to least recent?? maybe
ascending oldness??????
This commit is contained in:
əlemi 2024-04-12 22:41:04 +02:00
parent d3d5f98dfd
commit 576e809b69
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 4 additions and 3 deletions

View file

@ -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>()

View file

@ -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>()

View file

@ -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>()