Reordered state extractors.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user