The findById method of the controller ignores the query objects making it impossible to interact with from outside. A common scenario where you might want to interact with the query is, for example, the following.
- I want to fetch a resource by its id by calling:
GET /pets/1234 where 1234 is its id.
- I want to make sure that only the owner of the resource can access it, so I want to modify the default query { "id": "1234" } and turn it into { "owner":req.currentUser,"id":"1234" }
At the moment this is not possible, so we might need to modify the findById method of the controller in order to support it.
The findById method of the controller ignores the query objects making it impossible to interact with from outside. A common scenario where you might want to interact with the query is, for example, the following.
GET /pets/1234where 1234 is its id.At the moment this is not possible, so we might need to modify the findById method of the controller in order to support it.