Repo layer refactor.

This commit is contained in:
2026-10-08 22:18:50 +02:00
parent 3709fcbe02
commit 7732b0ecc5
11 changed files with 216 additions and 195 deletions
+11 -12
View File
@@ -39,18 +39,17 @@ async fn list_accounts(
State(pool): State<PgPool>,
Query(query): Query<QueryParams>,
) -> Result<Json<Vec<AccountResponse>>, AppError> {
let accounts = repository::accounts::list(
&pool,
repository::accounts::Query {
name: query.name,
limit: Some(query.limit.unwrap_or(20)),
offset: query.offset,
},
)
.await?
.into_iter()
.map(AccountResponse::from)
.collect();
let query = repository::accounts::Query {
name: query.name,
limit: Some(query.limit.unwrap_or(20)),
offset: query.offset,
};
let accounts = repository::accounts::list(&pool, query)
.await?
.into_iter()
.map(AccountResponse::from)
.collect();
Ok(Json(accounts))
}