Merge branch 'master' into story-138187767-mod-flag-names

This commit is contained in:
gaba
2017-03-07 13:04:28 +01:00
135 changed files with 3248 additions and 1534 deletions
+8 -1
View File
@@ -1,5 +1,6 @@
const {Error: {ValidationError}} = require('mongoose');
const errors = require('../../errors');
const CommentsService = require('../../services/comments');
/**
* Wraps up a promise to return an object with the resolution of the promise
@@ -51,7 +52,13 @@ const RootMutation = {
},
setCommentStatus(_, {id, status}, {mutators: {Comment}}) {
return wrapResponse(null)(Comment.setCommentStatus({id, status}));
}
},
addCommentTag(_, {id, tag}, {mutators: {Comment}}) {
return wrapResponse('comment')(Comment.addCommentTag({id, tag}).then(() => CommentsService.findById(id)));
},
removeCommentTag(_, {id, tag}, {mutators: {Comment}}) {
return wrapResponse('comment')(Comment.removeCommentTag({id, tag}).then(() => CommentsService.findById(id)));
},
};
module.exports = RootMutation;