[openstreetmap/openstreetmap-website] Add profile location (PR #5302)

Tom Hughes notifications at github.com
Tue Feb 25 18:40:07 UTC 2025


@tomhughes commented on this pull request.



> @@ -148,7 +148,11 @@ def search_osm_nominatim_reverse
                     :type => object_type, :id => object_id)
     end
 
-    render :action => "results"
+    if params[:format] == "json"
+      render :json => @results
+    else
+      render :action => "results"
+    end

This should probably use [respond_to](https://api.rubyonrails.org/classes/ActionController/MimeResponds.html#method-i-respond_to).

> +      return;
+    }
+
+    const geocodeUrl = "/geocoder/search_osm_nominatim_reverse";
+    const params = {
+      format: "json",
+      lat,
+      lon,
+      zoom: 3
+    };
+
+    if (locationInput.request) {
+      locationInput.request.abort();
+    }
+
+    locationInput.request = $.ajax({

This should be changed to use `fetch` now.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5302/review/2642090400 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250225/e46f7c86/attachment.htm>


More information about the rails-dev mailing list