@tomhughes requested changes on this pull request.
In addition to the specific inline requests can you please squash the second
commit into the first one.
> @@ -214,6 +214,7 @@ def stub_overpass(nearby_elements: [],
> enclosing_elements: [])
elements = data.includes("is_in") ?
#{enclosing_elements.to_json} : #{nearby_elements.to_json};
return Promise.resolve({
+ ok:true,
Space after the colon please, for consistency:
```suggestion
ok: true,
```
> @@ -224,9 +238,7 @@ OSM.Query = function (map) {
})
.catch(function (error) {
if (error.name === "AbortError") return;
-
Why are we getting rid of these blank lines?
> - .then(response => response.json())
+ .then(async response => {
+ if (response.ok) {
+ return response.json();
+ }
+
+ const status = response.statusText || response.status;
+
+ if (response.status !== 400) {
+ throw new Error(status);
+ }
+
+ const text = await response.text();
+ throw new Error(text || status);
+ })
+
Get rid of this blank line please - it needs to be clear that there's another
operation chained after this call.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6724#pullrequestreview-3683709344
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/6724/review/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev