@hlfan approved this pull request.
I like how this is taking shape!
> + .then((response) => {
+ if (response.ok) {
+ return response;
+ } else {
+ throw new Error(`Got response with status ${response.status}
${response.statusText}`);
+ }
+ })
.then(response => response.json())
One stylistic idea/nit to group the callbacks more:
```suggestion
.then(resp => {
if (resp.ok) return resp.json();
throw new Error(`Got response with status ${resp.status}
${resp.statusText}`);
})
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7132#pullrequestreview-4461704954
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/7132/review/[email protected]>_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev