[openstreetmap/openstreetmap-website] Get directions using fetch (PR #5642)

Marwin Hochfelsner notifications at github.com
Mon Feb 10 07:53:11 UTC 2025


@hlfan commented on this pull request.



> @@ -99,22 +99,18 @@
               language: I18n.currentLocale()
             }
           })
-        };
-        return $.ajax({
-          url: OSM.FOSSGIS_VALHALLA_URL,
-          data,
-          dataType: "json",
-          success: function ({ trip }) {
-            if (trip.status === 0) {
-              callback(false, _processDirections(trip.legs));
-            } else {
-              callback(true);
+        });
+        return fetch(OSM.FOSSGIS_VALHALLA_URL + "?" + query)
+          .then(response => response.json())
+          .then(({ trip }) => {
+            if (trip.status !== 0) {

Made this change to all error callbacks.

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

Message ID: <openstreetmap/openstreetmap-website/pull/5642/review/2604921036 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250209/789df7f6/attachment.htm>


More information about the rails-dev mailing list