diff --git a/imphnen-hackathon/src/admin/infrastructure/http/routes.rs b/imphnen-hackathon/src/admin/infrastructure/http/routes.rs index 3188c35..811500a 100644 --- a/imphnen-hackathon/src/admin/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/admin/infrastructure/http/routes.rs @@ -33,8 +33,7 @@ pub fn hackathon_admin_routes(pool: Arc) -> Router { ) .route("/admin/winners/{team_id}", delete(admin_remove_winner)) .layer(Extension(service)) - .layer(Extension(pool.clone())) .layer(from_fn(admin_only)) - .layer(Extension(pool)) .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool)) } diff --git a/imphnen-hackathon/src/chat/infrastructure/http/routes.rs b/imphnen-hackathon/src/chat/infrastructure/http/routes.rs index 129e326..d9dca59 100644 --- a/imphnen-hackathon/src/chat/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/chat/infrastructure/http/routes.rs @@ -22,6 +22,6 @@ pub fn build_chat_routes(pool: Arc) -> Router { ) .route("/chat/messages/{message_id}", delete(delete_message_handler)) .layer(Extension(service)) - .layer(Extension(pool)) .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool)) } diff --git a/imphnen-hackathon/src/invitations/infrastructure/http/routes.rs b/imphnen-hackathon/src/invitations/infrastructure/http/routes.rs index dc33eca..c379d30 100644 --- a/imphnen-hackathon/src/invitations/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/invitations/infrastructure/http/routes.rs @@ -26,6 +26,6 @@ pub fn build_invitation_routes(pool: Arc) -> Router { post(invite_team_member_handler), ) .layer(Extension(service)) - .layer(Extension(pool)) .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool)) } diff --git a/imphnen-hackathon/src/join_requests/infrastructure/http/routes.rs b/imphnen-hackathon/src/join_requests/infrastructure/http/routes.rs index 96f339c..cef7961 100644 --- a/imphnen-hackathon/src/join_requests/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/join_requests/infrastructure/http/routes.rs @@ -30,6 +30,6 @@ pub fn build_join_request_routes(pool: Arc) -> Router { post(respond_to_join_request_handler), ) .layer(Extension(service)) - .layer(Extension(pool)) .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool)) } diff --git a/imphnen-hackathon/src/storage/infrastructure/http/routes.rs b/imphnen-hackathon/src/storage/infrastructure/http/routes.rs index 77bab99..04f2b25 100644 --- a/imphnen-hackathon/src/storage/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/storage/infrastructure/http/routes.rs @@ -18,6 +18,6 @@ pub fn hackathon_storage_routes( .route("/upload/team", post(upload_team_handler)) .route("/upload/submission", post(upload_submission_handler)) .layer(Extension(service)) - .layer(Extension(pool)) .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool)) } diff --git a/imphnen-hackathon/src/submissions/infrastructure/http/routes.rs b/imphnen-hackathon/src/submissions/infrastructure/http/routes.rs index 9efa95d..be7c3e3 100644 --- a/imphnen-hackathon/src/submissions/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/submissions/infrastructure/http/routes.rs @@ -37,6 +37,6 @@ pub fn hackathon_submissions_routes(pool: Arc) -> Router { post(cancel_submission_handler), ) .layer(Extension(service)) - .layer(Extension(pool)) .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool)) } diff --git a/imphnen-hackathon/src/teams/infrastructure/http/routes.rs b/imphnen-hackathon/src/teams/infrastructure/http/routes.rs index 25275d1..79bd104 100644 --- a/imphnen-hackathon/src/teams/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/teams/infrastructure/http/routes.rs @@ -33,8 +33,8 @@ pub fn build_team_routes(pool: Arc) -> Router { delete(remove_member_handler), ) .layer(Extension(service)) - .layer(Extension(pool.clone())) - .layer(from_fn(hackathon_auth_middleware)); + .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool.clone())); Router::new().merge(public).merge(protected) } diff --git a/imphnen-hackathon/src/users/infrastructure/http/routes.rs b/imphnen-hackathon/src/users/infrastructure/http/routes.rs index fece8a4..06efd63 100644 --- a/imphnen-hackathon/src/users/infrastructure/http/routes.rs +++ b/imphnen-hackathon/src/users/infrastructure/http/routes.rs @@ -19,6 +19,6 @@ pub fn hackathon_users_routes(pool: Arc) -> Router { .route("/users/{user_id}", get(get_user_handler)) .route("/users/{user_id}/teams", get(get_user_teams_handler)) .layer(Extension(service)) - .layer(Extension(pool)) .layer(from_fn(hackathon_auth_middleware)) + .layer(Extension(pool)) }