https://github.com/travist/resourcejs/blob/master/Resource.js#L559
When the before hook is called, it passes search as the item instead of query. Why is that? It makes it harder to write hooks because index() passes the query as item. It'd be great to be consistent and have them both pass query. That seems like the way to go since you can still access search via the query.
The only problem is that this is a breaking change. Folks could be depending on search being passed instead of query. Might be something to flag for the next major version bump?
I'm currently working around this by accessing the query through req.modelQuery. It works, but is a strange dependency to have between my before handlers and before hooks.
https://github.com/travist/resourcejs/blob/master/Resource.js#L559
When the before hook is called, it passes
searchas theiteminstead ofquery. Why is that? It makes it harder to write hooks becauseindex()passes thequeryasitem. It'd be great to be consistent and have them both passquery. That seems like the way to go since you can still accesssearchvia thequery.The only problem is that this is a breaking change. Folks could be depending on
searchbeing passed instead ofquery. Might be something to flag for the next major version bump?I'm currently working around this by accessing the query through req.modelQuery. It works, but is a strange dependency to have between my before handlers and before hooks.