Can delete a movement

This commit is contained in:
2025-04-19 22:00:27 +02:00
parent 89ffb558ac
commit 9d345b9c42
3 changed files with 17 additions and 0 deletions

View File

@ -127,3 +127,10 @@ pub async fn get_list_account(account_id: AccountID) -> anyhow::Result<Vec<Movem
.filter(movements::dsl::account_id.eq(account_id.0))
.get_results(&mut db()?)?)
}
/// Delete a movement
pub async fn delete(id: MovementID) -> anyhow::Result<()> {
diesel::delete(movements::dsl::movements.filter(movements::dsl::id.eq(id.0)))
.execute(&mut db()?)?;
Ok(())
}