Added a transaction for deleting all
This commit is contained in:
@ -79,7 +79,7 @@ impl Entity {
|
||||
|
||||
/// Deletes all the user's accounts from DB
|
||||
#[inline]
|
||||
pub async fn delete_all(user_id: u64, db: &DatabaseConnection) -> crate::Result<()> {
|
||||
pub async fn delete_all(user_id: u64, db: &impl ConnectionTrait) -> crate::Result<()> {
|
||||
Self::delete_many()
|
||||
.filter(Column::UserId.eq(user_id))
|
||||
.exec(db)
|
||||
|
@ -33,7 +33,7 @@ impl Entity {
|
||||
}
|
||||
|
||||
/// Removes a master password of the user from the database
|
||||
pub async fn remove(user_id: u64, db: &DatabaseConnection) -> Result<(), DbErr> {
|
||||
pub async fn remove(user_id: u64, db: &impl ConnectionTrait) -> Result<(), DbErr> {
|
||||
Self::delete_by_id(user_id).exec(db).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user