Skip to content

Commit

Permalink
sort stops by their order on the route
Browse files Browse the repository at this point in the history
  • Loading branch information
jprusik committed Jan 11, 2024
1 parent ff62742 commit 49c389e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hooks/useRouteStops.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ export function useRouteStops (
const [error, setError] = useState<Error | null>(null);
const [isLoading, setIsLoading] = useState<boolean>(true);

// Ideally, we'd sort the stops by route order instead of name,
// but that's unavailable AFAIK
const requestURL = `${REQUEST_DOMAIN}/stops/?filter[route]=${routeId}&sort=name`;
// `filter[direction_id]=0` implicitly sorts the stops by their order on the route
const requestURL = `${REQUEST_DOMAIN}/stops/?filter[route]=${routeId}&filter[direction_id]=0`;

function refetch () {
setData(null);
Expand Down

0 comments on commit 49c389e

Please sign in to comment.