diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs index 5e69f42cfe..7d314bb3df 100644 --- a/crates/router/src/routes/app.rs +++ b/crates/router/src/routes/app.rs @@ -703,13 +703,12 @@ impl Routing { ) })), ) - .service(web::resource("/list/{profile_id}").route(web::get().to( - |state, req, path, query: web::Query| { + .service(web::resource("/list/profile").route(web::get().to( + |state, req, query: web::Query| { routing::list_routing_configs_for_profile( state, req, query, - path, &TransactionType::Payment, ) }, @@ -796,6 +795,16 @@ impl Routing { ) })), ) + .service(web::resource("/payouts/list/profile").route(web::get().to( + |state, req, query: web::Query| { + routing::list_routing_configs_for_profile( + state, + req, + query, + &TransactionType::Payout, + ) + }, + ))) .service(web::resource("/payouts/active").route(web::get().to( |state, req, query_params| { routing::routing_retrieve_linked_config( diff --git a/crates/router/src/routes/routing.rs b/crates/router/src/routes/routing.rs index 8527aa8628..09bf77c62e 100644 --- a/crates/router/src/routes/routing.rs +++ b/crates/router/src/routes/routing.rs @@ -216,11 +216,9 @@ pub async fn list_routing_configs_for_profile( state: web::Data, req: HttpRequest, query: web::Query, - path: web::Path, transaction_type: &enums::TransactionType, ) -> impl Responder { let flow = Flow::RoutingRetrieveDictionary; - let path = path.into_inner(); Box::pin(oss_api::server_wrap( flow, state, @@ -238,17 +236,11 @@ pub async fn list_routing_configs_for_profile( #[cfg(not(feature = "release"))] auth::auth_type( &auth::HeaderAuth(auth::ApiKeyAuth), - &auth::JWTAuthProfileFromRoute { - profile_id: path, - required_permission: Permission::RoutingRead, - }, + &auth::JWTAuth(Permission::RoutingRead), req.headers(), ), #[cfg(feature = "release")] - &auth::JWTAuthProfileFromRoute { - profile_id: path, - required_permission: Permission::RoutingRead, - }, + &auth::JWTAuth(Permission::RoutingRead), api_locking::LockAction::NotApplicable, )) .await