Check account membership on DB level.

This commit is contained in:
2026-10-11 14:03:39 +02:00
parent 3faea141dd
commit 793f71e32e
12 changed files with 261 additions and 44 deletions
+16
View File
@@ -62,6 +62,22 @@ where
Ok(account)
}
pub async fn get_by_id_locking<'e, E>(
executor: E,
user_id: Uuid,
id: Uuid,
) -> Result<Option<Account>, RepositoryError>
where
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
{
let account = db::get_by_id_locking(executor, user_id, id)
.await?
.map(decode)
.transpose()?;
Ok(account)
}
pub async fn get_by_ids<'e, E>(
executor: E,
user_id: Uuid,