Some more cleanup.

This commit is contained in:
2026-09-27 10:02:30 +02:00
parent 67153c79bb
commit 5f4c9bdf90
5 changed files with 27 additions and 31 deletions
+4 -4
View File
@@ -17,11 +17,11 @@ use crate::{
pub fn create_router() -> axum::Router<PgPool> {
axum::Router::new()
.route("/", axum::routing::get(get_transactions))
.route("/", axum::routing::get(query_transactions))
.route(
"/{id}",
axum::routing::get(get_transaction)
.put(put_transaction)
.put(upsert_transaction)
.delete(delete_transaction),
)
}
@@ -45,7 +45,7 @@ impl TryFrom<QueryParams> for repository::Query {
#[axum::debug_handler]
#[tracing::instrument(skip(pool))]
async fn get_transactions(
async fn query_transactions(
State(pool): State<PgPool>,
Query(query): Query<QueryParams>,
) -> Result<Json<Vec<TransactionResponse>>, AppError> {
@@ -73,7 +73,7 @@ async fn get_transaction(
#[axum::debug_handler]
#[tracing::instrument(skip(pool, transaction))]
async fn put_transaction(
async fn upsert_transaction(
State(pool): State<PgPool>,
Path(id): Path<Uuid>,
Json(transaction): Json<TransactionRequest>,