Some more cleanup.
This commit is contained in:
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user