@AntonKhorev commented on this pull request.


> +        const textarea = content.find("textarea");
+        if (textarea.length) {
+          data.set("text", textarea.val());
+        }

I guess @hlfan wants to say that the OSM API reacts the same to empty `text` 
parameters and missing `text` parameters. Internally it's not true because note 
comment body is nullable. On the other hand we are unlikely to make a 
distinction between "" and null when we'll be deciding if what's currently 
stored as a comment is a real comment or not. And the following line is also 
ignoring this distinction because the comment model creates a `RichText` object 
even for null-comments:

https://github.com/openstreetmap/openstreetmap-website/blob/f1686b59cd92d2af077d49ef41440bc581016ac8/app/views/api/notes/_note.xml.builder#L30

This `if` is always true.

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

Message ID: 
<openstreetmap/openstreetmap-website/pull/5842/review/2715318...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to