diff --git a/src/entity/account.rs b/src/entity/account.rs index fa1b9dc..0af005d 100644 --- a/src/entity/account.rs +++ b/src/entity/account.rs @@ -141,9 +141,7 @@ impl Entity { account_name: impl Into, db: &DatabaseConnection, ) -> crate::Result> { - Self::find() - .filter(Column::UserId.eq(user_id)) - .filter(Column::Name.eq(account_name.into())) + Self::find_by_id((user_id, account_name.into())) .one(db) .await .map_err(Into::into) diff --git a/src/entity/master_pass.rs b/src/entity/master_pass.rs index 0609657..338d4f2 100644 --- a/src/entity/master_pass.rs +++ b/src/entity/master_pass.rs @@ -62,10 +62,9 @@ impl Entity { /// Checks if the master password for the user exists pub async fn exists(user_id: u64, db: &DatabaseConnection) -> crate::Result { - let id = Self::find() + let id = Self::find_by_id(user_id) .select_only() .column(Column::UserId) - .filter(Column::UserId.eq(user_id)) .into_tuple::() .one(db) .await?;