feat: feed ux improvements
This commit is contained in:
@@ -48,11 +48,15 @@ pub struct ActivityFeedPageData {
|
||||
pub current_offset: u32,
|
||||
pub has_more: bool,
|
||||
pub limit: u32,
|
||||
pub filter: String,
|
||||
pub sort_by: String,
|
||||
pub search: String,
|
||||
}
|
||||
|
||||
pub struct UsersPageData {
|
||||
pub ctx: HtmlPageContext,
|
||||
pub users: Vec<UserSummary>,
|
||||
pub remote_actors: Vec<RemoteActorView>,
|
||||
}
|
||||
|
||||
pub struct ProfilePageData {
|
||||
|
||||
@@ -14,8 +14,11 @@ pub struct GetReviewHistoryQuery {
|
||||
}
|
||||
|
||||
pub struct GetActivityFeedQuery {
|
||||
pub limit: Option<u32>,
|
||||
pub offset: Option<u32>,
|
||||
pub limit: u32,
|
||||
pub offset: u32,
|
||||
pub sort_by: domain::ports::FeedSortBy,
|
||||
pub search: Option<String>,
|
||||
pub following: Option<domain::ports::FollowingFilter>,
|
||||
}
|
||||
|
||||
pub struct GetUsersQuery;
|
||||
|
||||
@@ -11,6 +11,13 @@ pub async fn execute(
|
||||
ctx: &AppContext,
|
||||
query: GetActivityFeedQuery,
|
||||
) -> Result<Paginated<FeedEntry>, DomainError> {
|
||||
let page = PageParams::new(query.limit, query.offset)?;
|
||||
ctx.diary_repository.query_activity_feed(&page).await
|
||||
let page = PageParams::new(Some(query.limit), Some(query.offset))?;
|
||||
ctx.diary_repository
|
||||
.query_activity_feed_filtered(
|
||||
&page,
|
||||
&query.sort_by,
|
||||
query.search.as_deref(),
|
||||
query.following.as_ref(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user