inject router on HandleInput

This commit is contained in:
Joel Wetzell
2025-12-06 23:08:05 -06:00
parent 9a06949b5b
commit 388851f8bd
2 changed files with 9 additions and 10 deletions

View File

@@ -95,7 +95,7 @@ func NewRouter(ctx context.Context, config config.Config) (*Router, []ModuleErro
var routeErrors []RouteError
for routeIndex, routeDecl := range config.Routes {
route, err := NewRoute(routeIndex, routeDecl, &router)
route, err := NewRoute(routeIndex, routeDecl)
if err != nil {
if routeErrors == nil {
routeErrors = []RouteError{}
@@ -138,7 +138,7 @@ func (r *Router) HandleInput(sourceId string, payload any) []RoutingError {
var routingErrors []RoutingError
for routeIndex, route := range r.RouteInstances {
if route.Input == sourceId {
err := route.HandleInput(sourceId, payload)
err := route.HandleInput(sourceId, payload, r)
if err != nil {
if routingErrors == nil {
routingErrors = []RoutingError{}