Fix new post read/unread handling
This commit is contained in:
@@ -41,6 +41,7 @@ pub enum Thread {
|
||||
#[derive(Debug, SimpleObject)]
|
||||
pub struct NewsPost {
|
||||
pub thread_id: String,
|
||||
pub is_read: bool,
|
||||
pub slug: String,
|
||||
pub site: String,
|
||||
pub title: String,
|
||||
|
||||
@@ -207,6 +207,7 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
|
||||
}
|
||||
}
|
||||
let title = clean_title(&r.title.unwrap_or("NO TITLE".to_string())).await?;
|
||||
let is_read = r.is_read.unwrap_or(false);
|
||||
let timestamp = r
|
||||
.date
|
||||
.expect("post missing date")
|
||||
@@ -214,6 +215,7 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
|
||||
.unix_timestamp();
|
||||
Ok(Thread::News(NewsPost {
|
||||
thread_id,
|
||||
is_read,
|
||||
slug,
|
||||
site,
|
||||
title,
|
||||
|
||||
Reference in New Issue
Block a user