Remove subscription code

This commit is contained in:
Chi Vinh Le
2017-08-02 18:14:52 +07:00
parent 94901d40f3
commit b6b7570bcc
8 changed files with 4 additions and 51 deletions
-4
View File
@@ -7,10 +7,6 @@ const {ADD_COMMENT_TAG, REMOVE_COMMENT_TAG} = require('../../perms/constants');
*/
const modify = async ({user, loaders: {Tags}, pubsub}, operation, {name, id, item_type, asset_id}) => {
if (operation.name === 'add') {
pubsub.publish('commentFeatured', {});
}
// Get the global list of tags from the dataloader.
const tags = await Tags.getAll.load({id, item_type, asset_id});
-3
View File
@@ -14,9 +14,6 @@ const Subscription = {
commentFlagged(comment) {
return comment;
},
commentFeatured(comment) {
return comment;
},
userBanned(user) {
return user;
},
-11
View File
@@ -24,7 +24,6 @@ const {
SUBSCRIBE_ALL_USER_SUSPENDED,
SUBSCRIBE_ALL_USER_BANNED,
SUBSCRIBE_ALL_USERNAME_REJECTED,
SUBSCRIBE_COMMENT_FEATURED
} = require('../perms/constants');
/**
@@ -87,16 +86,6 @@ const setupFunctions = plugins.get('server', 'setupFunctions').reduce((acc, {plu
}
},
}),
commentFeatured: (options, args) => ({
commentFeatured: {
filter: (comment, context) => {
if (!args.asset_id && (!context.user || !context.user.can(SUBSCRIBE_COMMENT_FEATURED))) {
return false;
}
return !args.asset_id || comment.asset_id === args.asset_id;
}
},
}),
userSuspended: (options, args) => ({
userSuspended: {
filter: (user, context) => {
-4
View File
@@ -1046,10 +1046,6 @@ type Subscription {
# Requires the `ADMIN` or `MODERATOR` role.
commentFlagged(asset_id: ID): Comment
# Get an update whenever a comment is featured.
# Requires the `ADMIN` or `MODERATOR` role.
commentFeatured(asset_id: ID): Comment
# Get an update whenever a comment has been accepted.
# Requires the `ADMIN` or `MODERATOR` role.
commentAccepted(asset_id: ID): Comment