[openstreetmap/openstreetmap-website] Note subscriptions API (PR #5314)

Anton Khorev notifications at github.com
Sun Nov 17 23:21:54 UTC 2024


@AntonKhorev commented on this pull request.



> @@ -0,0 +1,22 @@
+module Api
+  class NoteSubscriptionsController < ApiController
+    before_action :check_api_writable
+    before_action :authorize
+
+    authorize_resource
+
+    def create
+      note_id = params[:note_id].to_i
+      note = Note.find(note_id)
+      note.subscribers << current_user
+    rescue ActiveRecord::RecordNotUnique
+      head :conflict

added error messages

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

Message ID: <openstreetmap/openstreetmap-website/pull/5314/review/2441265815 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241117/1ab019ea/attachment.htm>


More information about the rails-dev mailing list