Closed conghai closed 6 years ago
I do not think it is linked to paginate but to the fact that you are returning an Array instead of an Object. Normally the the hooks should have been able to handle it. I ll dig into it.
Normally it should wrap and un-wrap the data.
I have found the problem. Feathers has changed slightly the way it handles hooks. Before, when you where setting the result property in a before hook it was skipping the service and the the after hooks.
Now it only skips the service, but goes through the remaining hooks. I have slightly amended the way the hooks are handling arrays it should be back to normal with the next release.
if your service returns an []
the cache will work as expected, but will not attached any property to what is returned. Internally an object with the property wrapped
will be saved to redis, when such object is retrieved from redis it is unwrapped and only the array is returned. This is to accommodate the issue #10
I hope this solve your issue. Do not hesitate to post back. Note that as Friday evening I am on vacations for two weeks with (almost) no access to internet. I will publish the change ASAP after some more testing.
- Cache working well if has paging enable in Service.
Configs
Results format
- But Service without paging! results format will different the first time (before cache)
Configs
Results format