add: forge pinned tickets

This commit is contained in:
trisua 2025-06-10 22:12:22 -04:00
parent 68071b96c8
commit 46f8aea538
5 changed files with 44 additions and 16 deletions

View file

@ -171,13 +171,13 @@ pub async fn tickets_request(
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
};
// let pinned = match data.0.get_pinned_posts_by_community(community.id).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)),
// },
// Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
// };
let pinned = match data.0.get_pinned_posts_by_community(community.id).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)),
},
Err(e) => return Err(Html(render_error(e, &jar, &data, &user).await)),
};
// init context
let lang = get_lang!(jar, data.0);
@ -195,7 +195,7 @@ pub async fn tickets_request(
) = community_context_bools!(data, user, community);
context.insert("feed", &feed);
// context.insert("pinned", &pinned);
context.insert("pinned", &pinned);
context.insert("page", &props.page);
community_context(
&mut context,