Sign File After Populate
app.service('posts').find({query:{
$populate: {
path: 'admin',
populate: {
path: 'user',
populate: {
path: 'profile',
populate: {
path: 'logo'
}
}
}
}
}})in the posts.hooks.js:
const {hooks} = require('feathers-mongoose-casl');
const {singFileAfterPopulate} = hooks;
module.exports = {
after: {
find: [
singFileAfterPopulate({
path: 'admin.user.profile.logo',
fileKeyName: 'file',
singUrlKeyName:'file'
})
],
get: [],
create: [],
update: [],
patch: [],
remove: []
}
....
}Last updated
Was this helpful?