bug fixes, removed dead code

This commit is contained in:
Wyatt Johnson
2017-08-21 16:05:35 -06:00
parent 78d4740abe
commit eec0e18600
3 changed files with 9 additions and 42 deletions
+2 -6
View File
@@ -174,9 +174,7 @@ const createComment = async (context, {tags = [], body, asset_id, parent_id = nu
// perform these increments in the event that we do have a new comment that
// is approved or without a comment.
if (status === 'NONE' || status === 'APPROVED') {
if (parent_id != null) {
Comments.countByParentID.incr(parent_id);
} else {
if (parent_id === null) {
Comments.parentCountByAssetID.incr(asset_id);
}
Comments.countByAssetID.incr(asset_id);
@@ -338,9 +336,7 @@ const setStatus = async ({user, loaders: {Comments}, pubsub}, {id, status}) => {
// be nice if we could decrement the counters here, but that would result
// in us having to know the initial state of the comment, which would
// require another database query.
if (comment.parent_id != null) {
Comments.countByParentID.clear(comment.parent_id);
} else {
if (comment.parent_id === null) {
Comments.parentCountByAssetID.clear(comment.asset_id);
}