Requirement is that for each get request I need to send all the objects in that table. For e.g. I make a request to get all clients (maybe with some filters) with certain limit for pagination purposes and in the response I want the result as array of all client objects and the count of total clients in the DB.
That means I not only need to intercept the find method for each controller or model (wherever its possible) as well as need to modify the response as well.
Current response is:
[
{
"firstName": "Bhupesh",
"lastName": "Gupta"
}
]
Required response is:
{
"count": 5,
"data": [
{
"firstName": "Bhupesh",
"lastName": "Gupta"
}
]
}