Slight polishing.

This commit is contained in:
2026-10-12 14:10:19 +02:00
parent 945ae46dbe
commit 93ce76305d
5 changed files with 37 additions and 13 deletions
+8 -3
View File
@@ -68,10 +68,15 @@ async fn get_scheduled_transaction(
let transaction = repository::recurring_transactions::get_by_id(&pool, user_id, id)
.await?
.ok_or(AppError::NotFound)?;
let accounts =
get_accounts_for_transactions(&pool, user_id, std::slice::from_ref(&transaction)).await?;
let account = repository::accounts::get_by_id(&pool, user_id, transaction.account_id)
.await?
.ok_or(AppError::RaceCondition)?; // Account should be accessible!
Ok(Json(create_response(transaction, &accounts, Utc::now())?))
Ok(Json(create_response(
transaction,
&HashMap::from([(account.id, account)]),
Utc::now(),
)?))
}
#[axum::debug_handler]