[openstreetmap/openstreetmap-website] Show blocked api response when interacting with notes (PR #4462)

Tom Hughes notifications at github.com
Tue Jan 16 18:53:18 UTC 2024


@tomhughes requested changes on this pull request.



> @@ -52,20 +52,17 @@ OSM.Note = function (map) {
           OSM.loadSidebarContent(path, function () {
             initialize(path, id, moveToNote);
           });
+        },
+        error: function (xhr) {
+          $(form).find("#comment-error").text(xhr.responseText);
+          $(form).find("#comment-error").prop("hidden", false);

I think these calls can be chained rather than doing the `find` twice?

Also should the `success` callback hide the error again, in case the user reads the message in a different tab than comes back and submits again?

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

Message ID: <openstreetmap/openstreetmap-website/pull/4462/review/1824637832 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240116/7211f373/attachment.htm>


More information about the rails-dev mailing list