server: fix thread id for news posts

This commit is contained in:
Bill Thiede 2024-08-31 13:23:25 -07:00
parent 85c762a297
commit 090a010a63

View File

@ -144,12 +144,12 @@ pub async fn tags(pool: &PgPool, _needs_unread: bool) -> Result<Vec<Tag>, Server
}
pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerError> {
let thread_id = thread_id
let id = thread_id
.strip_prefix(THREAD_PREFIX)
.expect("news thread doesn't start with '{THREAD_PREFIX}'")
.to_string();
let r = sqlx::query_file!("sql/thread.sql", thread_id)
let r = sqlx::query_file!("sql/thread.sql", id)
.fetch_one(pool)
.await?;