add: forum posts ui

This commit is contained in:
trisua 2025-08-03 23:24:57 -04:00
parent ef029c59b3
commit 2be87c397d
90 changed files with 1459 additions and 1299 deletions

View file

@ -932,7 +932,7 @@ pub async fn post_replies_request(
None => return Json(Error::NotAllowed.into()),
};
match data.get_replies_by_post(id, 12, props.page).await {
match data.get_replies_by_post(id, 12, props.page, "DESC").await {
Ok(posts) => {
let ignore_users = crate::ignore_users_gen!(user!, #data);
Json(ApiReturn {

View file

@ -835,7 +835,16 @@ pub async fn post_request(
// ...
let ignore_users = crate::ignore_users_gen!(user, data);
let feed = match data.0.get_replies_by_post(post.id, 12, props.page).await {
let feed = match data
.0
.get_replies_by_post(
post.id,
12,
props.page,
if community.is_forum { "ASC" } else { "DESC" },
)
.await
{
Ok(p) => match data.0.fill_posts(p, &ignore_users, &user).await {
Ok(p) => p,
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),