[openstreetmap/openstreetmap-website] Add Messages API (PR #4605)

Milan Cvetkovic notifications at github.com
Fri Mar 22 15:18:26 UTC 2024


@milan-cvetkovic commented on this pull request.



> +        raise OSM::APIAccessDenied
+      end
+
+      @message.save!
+
+      # Return a copy of the message
+      respond_to do |format|
+        format.xml { render :action => :show }
+        format.json { render :action => :show }
+      end
+    end
+
+    private
+
+    def show_messages
+      if params[:min_id]

I am not sure about this - how would the request for latest messages look like with `to` or `to_id`?

get 10 messages in descending order, then get the following 10 messages in desc order (assuming the smallest id from 1st request was 1000):
```
GET /api/0.6/user/messages/inbox?to=0&limit=10
GET /api/0.6/user/messages/inbox?to=1000&limit=10
```

instead of:
```
GET /api/0.6/user/messages/inbox?max_id=0&limit=10
GET /api/0.6/user/messages/inbox?max_id=1000&limit=10
```

Here `max_id` would imply descending, it wouldn't be so obvious if the name of parameter is named `to` or `to_id`.


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

Message ID: <openstreetmap/openstreetmap-website/pull/4605/review/1955094229 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240322/650ff21e/attachment.htm>


More information about the rails-dev mailing list