You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(createOne, updateById, updateOne): Pass resolveParams to beforeRecordMutate callback
Now you may made some context spicific checks right before apply updates to the document. Eg. check ownership
User.find('$updateOne').wrapResolve(next => rp => {
rp.beforeRecordMutate = (doc, rp) => {
return rp.context.userId === doc.userId
? doc
: Promise.reject(new Error('Access denied. You should be owner of this record'));
}
return next(rp);
});
0 commit comments