Skip to content

Commit

Permalink
fix transit near me
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Mar 28, 2024
1 parent ea0b616 commit aef8624
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/js/algolia-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const TEMPLATES = {
`<span class="c-search-result__event-date">{{date}}</span>`
),
locations: hogan.compile(`
<a id="hit-{{id}}" class="c-search-result__link u-no-underline" url={{hitUrl}}>
<a id="hit-{{id}}" class="c-search-result__link u-no-underline" href={{hitUrl}}>
<span>{{{hitIcon}}}</span>
<span class="c-search-result__hit-name notranslate">{{{hitTitle}}}</span>
</a>
Expand Down Expand Up @@ -309,7 +309,8 @@ export function getUrl(hit, index) {
return _contentUrl(hit);

case "locations":
return "";
return `transit-near-me?address=${encodeURIComponent(hit.address)}`;

case "usemylocation":
return "#";

Expand Down
5 changes: 5 additions & 0 deletions lib/dotcom_web/controllers/transit_near_me/location.ex
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ defmodule DotcomWeb.TransitNearMeController.Location do
geocode_fn.(address)
end

defp do_get(%{"address" => address}, opts) do
geocode_fn = Keyword.fetch!(opts, :geocode_fn)
geocode_fn.(address)
end

defp do_get(%{}, _opts) do
:no_address
end
Expand Down

0 comments on commit aef8624

Please sign in to comment.