I have users and posts. Users can make posts. I am creating an endpoint for the posts. Does this make sense?
Posts
/posts - POST, create post
/posts?{uID} - GET, get posts for user
/posts?{pID} - GET, get post by id
/posts/{pID} - PUT, update post by id
Is this good design? It seems that both GET requests are too similar. Should I create something more distinct like:
/posts/users?{uID} - GET, get posts for user
Cons of the first: Additional logic on the backend (if else logic, to see which parameter was passed) Cons of the second: Additional endpoint