-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GraphQL Trip Requests #1253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me! Just a quick suggestion for cleanup
lib/actions/user.js
Outdated
function areRequestsSame(qp1, qp2) { | ||
// Everything except modes. | ||
// Exclude banned/preferred/unpreferred at this time. | ||
return ( | ||
qp1.bikeReluctance === qp2.bikeReluctance && | ||
qp1.carReluctance === qp2.carReluctance && | ||
qp1.date === qp2.date && | ||
qp1.departArrive === qp2.departArrive && | ||
qp1.from?.name === qp2.from?.name && | ||
qp1.departArrive === qp2.departArrive && | ||
qp1.time === qp2.time && | ||
qp1.to?.name === qp2.to?.name && | ||
qp1.walkReluctance === qp2.walkReluctance && | ||
qp1.walkSpeed === qp2.walkSpeed && | ||
qp1.wheelchair === qp2.wheelchair | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing this many checks, would it be possible to filter out the properties you don't want to compare (eg. modes and banned routes) and then compare using JSON.stringify
?
Description
This PR adds support for parsing trip request data from OTP-middleware that includes GraphQL variables, so that they are included in the Recent Searches list.
Support for old OTP1 query params in trip requests from OTP-middleware is removed.
Note that the label for a recent search includes the modes used, however the modes will not be updated upon clicking the recent search entry (the mode selector states are not passed or saved in the trip request).
PR Checklist