Skip to content

Commit

Permalink
fix journey planner query
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronClaydon committed Dec 15, 2024
1 parent eebf9de commit 9f84399
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/api/routes/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})
}
Expand All @@ -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(),
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataaggregator/source/journeyplanner/journeyplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9f84399

Please sign in to comment.