@tomhughes commented on this pull request.


> @@ -9,14 +9,17 @@ class GeocoderController < ApplicationController
   authorize_resource :class => false
 
   def search
-    @params = normalize_params
+    normalize_params

This could be a `before_action` now if we don't need to use the result?

> @@ -18,9 +21,14 @@ OSM.Search = function (map) {
   $(".search_form").on("submit", function (e) {
     e.preventDefault();
     $("header").addClass("closed");
-    const query = $(this).find("input[name=query]").val();
-    let search = "/";
-    if (query) search = "/search?" + new URLSearchParams({ query });
+    const params = new URLSearchParams;
+    for (const paramName of ["query", "zoom", "minlon", "minlat", "maxlon", 
"maxlat"]) {

If we're going to build the URL in the submit handler why not just add the 
parameters from the bounding box here instead of adding hidden input fields and 
an event handler to keep them up to date?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5863#pullrequestreview-2728756323
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5863/review/2728756...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to