adding a remove from db function

This commit is contained in:
Chris Cochrun 2025-09-17 09:27:10 -05:00
parent de0722b430
commit e2406b5462
6 changed files with 245 additions and 29 deletions

View file

@ -263,6 +263,17 @@ impl Model<Presentation> {
}
}
pub async fn remove_from_db(
db: PoolConnection<Sqlite>,
id: i32,
) -> Result<()> {
query!("DELETE FROM presentations WHERE id = $1", id)
.execute(&mut db.detach())
.await
.into_diagnostic()
.map(|_| ())
}
pub async fn update_presentation_in_db(
presentation: Presentation,
db: PoolConnection<Sqlite>,