From 3da2c94f689820815903a826f4682a7b8122d35f Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Mon, 11 Jul 2022 00:49:11 +0000 Subject: handlers/notes: only show not-deleted posts Signed-off-by: Xe Iaso --- src/handlers/notes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/handlers/notes.rs b/src/handlers/notes.rs index f49ee39..42f89ad 100644 --- a/src/handlers/notes.rs +++ b/src/handlers/notes.rs @@ -75,7 +75,7 @@ impl Into for Note { pub async fn index() -> super::Result { let conn = crate::establish_connection()?; - let mut stmt = conn.prepare("SELECT id, content, content_html, created_at, updated_at, deleted_at, reply_to FROM notes ORDER BY id DESC LIMIT 25")?; + let mut stmt = conn.prepare("SELECT id, content, content_html, created_at, updated_at, deleted_at, reply_to FROM notes WHERE deleted_at IS NULL ORDER BY id DESC LIMIT 25")?; let notes = stmt .query_map(params![], |row| { Ok(Note { @@ -101,7 +101,7 @@ pub async fn index() -> super::Result { pub async fn feed() -> super::Result> { let conn = crate::establish_connection()?; - let mut stmt = conn.prepare("SELECT id, content, content_html, created_at, updated_at, deleted_at, reply_to FROM notes ORDER BY id DESC LIMIT 25")?; + let mut stmt = conn.prepare("SELECT id, content, content_html, created_at, updated_at, deleted_at, reply_to FROM notes WHERE deleted_at IS NULL ORDER BY id DESC LIMIT 25")?; let notes = stmt .query_map(params![], |row| { Ok(Note { -- cgit v1.2.3