Reordered state extractors.

This commit is contained in:
2026-10-12 18:19:15 +02:00
parent 2b37fd6ebc
commit 51a1b85429
7 changed files with 30 additions and 29 deletions
+4 -4
View File
@@ -30,9 +30,9 @@ pub struct QueryParams {
#[tracing::instrument(skip(pool))]
async fn list_user_apps(
Auth(auth): Auth,
State(pool): State<PgPool>,
Path(user_id): Path<Uuid>,
Query(query): Query<QueryParams>,
State(pool): State<PgPool>,
) -> Result<Json<Vec<UserAppResponse>>, AppError> {
if auth.user_id() != user_id {
return Err(AppError::NotFound);
@@ -56,8 +56,8 @@ async fn list_user_apps(
#[tracing::instrument(skip(pool))]
async fn get_user_app(
Auth(auth): Auth,
State(pool): State<PgPool>,
Path((user_id, app_id)): Path<(Uuid, Uuid)>,
State(pool): State<PgPool>,
) -> Result<Json<UserAppResponse>, AppError> {
if auth.user_id() != user_id {
return Err(AppError::NotFound);
@@ -74,8 +74,8 @@ async fn get_user_app(
#[tracing::instrument(skip(pool, request))]
async fn upsert_user_app(
Auth(auth): Auth,
State(pool): State<PgPool>,
Path((user_id, app_id)): Path<(Uuid, Uuid)>,
State(pool): State<PgPool>,
Json(request): Json<UserAppRequest>,
) -> Result<(StatusCode, Json<UserAppResponse>), AppError> {
if auth.user_id() != user_id {
@@ -100,8 +100,8 @@ async fn upsert_user_app(
#[tracing::instrument(skip(pool))]
async fn delete_user_app(
Auth(auth): Auth,
State(pool): State<PgPool>,
Path((user_id, app_id)): Path<(Uuid, Uuid)>,
State(pool): State<PgPool>,
) -> Result<StatusCode, AppError> {
if auth.user_id() != user_id {
return Err(AppError::NotFound);