You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is not a solution to do this with a custom endpoint.
If you fetch the user object and your server returns the linked path for signed posts (and you have a SignedPost resource), it should follow the link definition url and fetch SignedPost objects.
You could also have your SignedPost resource belongs_to :user and fetch with SignedPost.where(user_id: [userid]).all
For example, we have two models:
User ans Post
Post belongs_to :user
User has_many :posts
I want to have custom endpoint in User model that returns his signed posts,
if I make something like this:
custom_endpoint :signed_posts, on: :member, request_method: :get
It goes to correct url:
/users/:id/signed_posts
but returns posts wrapped as User class objects
Is there any solutions for this?
The text was updated successfully, but these errors were encountered: