Can delete inbox entry

This commit is contained in:
2025-05-08 16:57:05 +02:00
parent 6c41b66d1c
commit 6e0d0fb48d
3 changed files with 16 additions and 0 deletions

View File

@@ -105,3 +105,9 @@ pub async fn get_by_id(entry_id: InboxEntryID) -> anyhow::Result<InboxEntry> {
.filter(inbox::dsl::id.eq(entry_id.0))
.get_result(&mut db()?)?)
}
/// Delete an inbox entry
pub async fn delete(id: InboxEntryID) -> anyhow::Result<()> {
diesel::delete(inbox::dsl::inbox.filter(inbox::dsl::id.eq(id.0))).execute(&mut db()?)?;
Ok(())
}