Fix typo in error name (#1180)
* fix typo in error name * fixed typo in docs Co-authored-by: erhodes <erik@space-nav.com>
This commit is contained in:
parent
31a8895e39
commit
69612fa507
@ -33,10 +33,10 @@ pub enum DbErr {
|
||||
/// After an insert statement it was impossible to retrieve the last_insert_id
|
||||
#[error("Failed to unpack last_insert_id")]
|
||||
UnpackInsertId,
|
||||
/// When updating, a model should know it's primary key to check
|
||||
/// When updating, a model should know its primary key to check
|
||||
/// if the record has been correctly updated, otherwise this error will occur
|
||||
#[error("Failed to get primary key from model")]
|
||||
UpdateGetPrimeryKey,
|
||||
UpdateGetPrimaryKey,
|
||||
/// The record was not found in the database
|
||||
#[error("RecordNotFound Error: {0}")]
|
||||
RecordNotFound(String),
|
||||
|
@ -116,7 +116,7 @@ where
|
||||
Updater::new(query).check_record_exists().exec(db).await?;
|
||||
let primary_key_value = match model.get_primary_key_value() {
|
||||
Some(val) => FromValueTuple::from_value_tuple(val),
|
||||
None => return Err(DbErr::UpdateGetPrimeryKey),
|
||||
None => return Err(DbErr::UpdateGetPrimaryKey),
|
||||
};
|
||||
let found = <A::Entity as EntityTrait>::find_by_id(primary_key_value)
|
||||
.one(db)
|
||||
|
Loading…
x
Reference in New Issue
Block a user