fix default mutation bug

This commit is contained in:
SachaG 2017-08-24 13:16:33 +09:00
parent c9fb536056
commit bac853d438

View file

@ -54,7 +54,7 @@ export const getDefaultMutations = (collectionName, options = {}) => ({
// check function called on a user and document to see if they can perform the operation // check function called on a user and document to see if they can perform the operation
check(user, document) { check(user, document) {
if (options.editCheck) { if (options.editCheck) {
return options.editCheck(user); return options.editCheck(user, document);
} }
if (!user || !document) return false; if (!user || !document) return false;
@ -96,7 +96,7 @@ export const getDefaultMutations = (collectionName, options = {}) => ({
check(user, document) { check(user, document) {
if (options.removeCheck) { if (options.removeCheck) {
return options.removeCheck(user); return options.removeCheck(user, document);
} }
if (!user || !document) return false; if (!user || !document) return false;