Reordered state extractors.
This commit is contained in:
@@ -35,8 +35,8 @@ pub struct QueryParams {
|
||||
#[tracing::instrument(skip(pool))]
|
||||
async fn list_scheduled_transactions(
|
||||
Auth(auth): Auth,
|
||||
State(pool): State<PgPool>,
|
||||
Query(query): Query<QueryParams>,
|
||||
State(pool): State<PgPool>,
|
||||
) -> Result<Json<Vec<ScheduledTransactionResponse>>, AppError> {
|
||||
let user_id = auth.user_id();
|
||||
|
||||
@@ -60,8 +60,8 @@ async fn list_scheduled_transactions(
|
||||
#[tracing::instrument(skip(pool))]
|
||||
async fn get_scheduled_transaction(
|
||||
Auth(auth): Auth,
|
||||
State(pool): State<PgPool>,
|
||||
Path(id): Path<Uuid>,
|
||||
State(pool): State<PgPool>,
|
||||
) -> Result<Json<ScheduledTransactionResponse>, AppError> {
|
||||
let user_id = auth.user_id();
|
||||
|
||||
@@ -83,8 +83,8 @@ async fn get_scheduled_transaction(
|
||||
#[tracing::instrument(skip(pool, transaction))]
|
||||
async fn upsert_scheduled_transaction(
|
||||
Auth(auth): Auth,
|
||||
State(pool): State<PgPool>,
|
||||
Path(id): Path<Uuid>,
|
||||
State(pool): State<PgPool>,
|
||||
Json(transaction): Json<ScheduledTransactionRequest>,
|
||||
) -> Result<(StatusCode, Json<ScheduledTransactionResponse>), AppError> {
|
||||
let user_id = auth.user_id();
|
||||
@@ -117,8 +117,8 @@ async fn upsert_scheduled_transaction(
|
||||
#[tracing::instrument(skip(pool))]
|
||||
async fn delete_scheduled_transaction(
|
||||
Auth(auth): Auth,
|
||||
State(pool): State<PgPool>,
|
||||
Path(id): Path<Uuid>,
|
||||
State(pool): State<PgPool>,
|
||||
) -> Result<StatusCode, AppError> {
|
||||
repository::recurring_transactions::delete_by_id(&pool, auth.user_id(), id)
|
||||
.await?
|
||||
|
||||
Reference in New Issue
Block a user