Merge branch 'next' into user-status-refactor

This commit is contained in:
Wyatt Johnson
2017-11-17 09:43:59 -07:00
23 changed files with 120 additions and 14 deletions
+8 -1
View File
@@ -2,6 +2,7 @@ const {
SUBSCRIBE_COMMENT_ACCEPTED,
SUBSCRIBE_COMMENT_REJECTED,
SUBSCRIBE_COMMENT_FLAGGED,
SUBSCRIBE_COMMENT_RESET,
SUBSCRIBE_ALL_COMMENT_EDITED,
SUBSCRIBE_ALL_COMMENT_ADDED,
SUBSCRIBE_ALL_USER_SUSPENDED,
@@ -59,12 +60,18 @@ const setupFunctions = {
}
return !args.asset_id || comment.asset_id === args.asset_id;
},
commentRejected: (options, args) => (comment, context) => {
commentRejected: (options, args, comment, context) => {
if (!context.user || !context.user.can(SUBSCRIBE_COMMENT_REJECTED)) {
return false;
}
return !args.asset_id || comment.asset_id === args.asset_id;
},
commentReset: (options, args, comment, context) => {
if (!context.user || !context.user.can(SUBSCRIBE_COMMENT_RESET)) {
return false;
}
return !args.asset_id || comment.asset_id === args.asset_id;
},
userSuspended: (options, args, user, context) => {
if (
!context.user