diff --git a/pkg/api/routes/planner.go b/pkg/api/routes/planner.go index 21ef145..f96f7ce 100644 --- a/pkg/api/routes/planner.go +++ b/pkg/api/routes/planner.go @@ -38,6 +38,7 @@ func getPlanBetweenStops(c *fiber.Ctx) error { if err != nil { c.SendStatus(fiber.StatusNotFound) return c.JSON(fiber.Map{ + "field": "origin", "error": err.Error(), }) } @@ -48,6 +49,7 @@ func getPlanBetweenStops(c *fiber.Ctx) error { if err != nil { c.SendStatus(fiber.StatusNotFound) return c.JSON(fiber.Map{ + "field": "destination", "error": err.Error(), }) } diff --git a/pkg/dataaggregator/source/journeyplanner/journeyplan.go b/pkg/dataaggregator/source/journeyplanner/journeyplan.go index 040ab67..1bd2eb5 100644 --- a/pkg/dataaggregator/source/journeyplanner/journeyplan.go +++ b/pkg/dataaggregator/source/journeyplanner/journeyplan.go @@ -23,7 +23,7 @@ func (s Source) JourneyPlanQuery(q query.JourneyPlan) (*ctdf.JourneyPlanResults, Stop: q.OriginStop, Count: q.Count * 10, StartDateTime: q.StartDateTime, - Filter: &bson.M{"path.destinationstopref": q.DestinationStop.PrimaryIdentifier}, + Filter: &bson.M{"path.destinationstopref": bson.M{"$in": append(q.DestinationStop.OtherIdentifiers, q.DestinationStop.PrimaryIdentifier)}}, }) if err != nil {