diff options
| author | Xe Iaso <me@christine.website> | 2022-07-11 00:49:11 +0000 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-07-11 00:49:11 +0000 |
| commit | 3da2c94f689820815903a826f4682a7b8122d35f (patch) | |
| tree | b5c8e52a8fb7770f7262d98a2077f98c3c808f4d | |
| parent | 7dd708c6613b8e617fe77a6a8ad177485b39c258 (diff) | |
| download | xesite-3da2c94f689820815903a826f4682a7b8122d35f.tar.xz xesite-3da2c94f689820815903a826f4682a7b8122d35f.zip | |
handlers/notes: only show not-deleted posts
Signed-off-by: Xe Iaso <me@christine.website>
| -rw-r--r-- | src/handlers/notes.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<xe_jsonfeed::Item> 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<Json<xe_jsonfeed::Feed>> { 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 { |
