[openstreetmap/openstreetmap-website] Load notes with remote control (PR #3718)

Anton Khorev notifications at github.com
Wed Sep 28 21:05:21 UTC 2022


@AntonKhorev commented on this pull request.



> @@ -37,7 +37,8 @@ OSM = {
   SEARCHING:               <%= image_path("searching.gif").to_json %>,
 
   apiUrl: function (object) {
-    var url = "/api/" + OSM.API_VERSION + "/" + object.type + "/" + object.id;
+    var apiType = object.type === "note" ? "notes" : object.type;

Not using apiUrl() is an option. Then the check for object.type will go to the calling code. "note" as a type is used by iD embedding code. While iD won't display a note, it's being directed to open the note location with links like https://www.openstreetmap.org/edit?note=1000 .

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

Message ID: <openstreetmap/openstreetmap-website/pull/3718/review/1124356919 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220928/6202403d/attachment.htm>


More information about the rails-dev mailing list