Do not throw RecordNotUpdated error

This commit is contained in:
Chris Tsang 2023-07-10 19:51:33 +08:00
parent 53caf94af9
commit d7a978642e
2 changed files with 2 additions and 6 deletions

View File

@ -153,11 +153,7 @@ impl Updater {
)
.all(db)
.await?;
// If we got an empty Vec then we are updating a row that does not exist.
match models.is_empty() {
true => Err(DbErr::RecordNotUpdated),
false => Ok(models),
}
Ok(models)
}
false => unimplemented!("Database backend doesn't support RETURNING"),
}

View File

@ -1,7 +1,7 @@
pub mod common;
pub use common::{bakery_chain::*, setup::*, TestContext};
pub use sea_orm::{entity::prelude::*, *};
use sea_orm::{entity::prelude::*, IntoActiveModel};
pub use sea_query::{Expr, Query};
use serde_json::json;