Persist user request
Example of use from hook:
const {callingParamsPersistUser} = require('feathers-mongoose-casl')
// Inside some hook
hooks({
before: {
get: [
async function(hook){
const productService = hook.app.service('products');
const product = await productService.find(callingParamsPersistUser(hook.params,{query: {'color': 'red'}}))
};
})Example of use from class:
async find (params) {
const productService = hook.app.service('products');
const product = await productService.find(callingParamsPersistUser(params,{query: {'color': 'red'}}))
}Last updated
Was this helpful?