@HolgerJeromin 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) {
The callback result can not be used.
```ts
if (trip.status !== 0) {
return callback(true);
}
return callback(false, _processDirections(trip.legs));
```
or
```ts
if (trip.status !== 0) {
callback(true);
return;
}
callback(false, _processDirections(trip.legs));
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5642#pullrequestreview-2604912111
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5642/review/2604912...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev