From 9dc57c82d1200266e9629f9bdc0baf298879a701 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 24 Jan 2017 13:27:22 -0700 Subject: [PATCH] Fixes to consts + services --- .travis-yml | 3 --- circle.yml | 1 + graph/loaders/comments.js | 8 -------- graph/loaders/users.js | 5 +---- graph/resolvers/action.js | 12 ------------ graph/resolvers/action_summary.js | 15 +-------------- 6 files changed, 3 insertions(+), 41 deletions(-) delete mode 100644 .travis-yml diff --git a/.travis-yml b/.travis-yml deleted file mode 100644 index 85242354a..000000000 --- a/.travis-yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 4 diff --git a/circle.yml b/circle.yml index b9cea6fed..20ab7b659 100644 --- a/circle.yml +++ b/circle.yml @@ -3,6 +3,7 @@ machine: version: 7 services: - docker + - redis test: override: diff --git a/graph/loaders/comments.js b/graph/loaders/comments.js index 84c6f7ed0..35463dfd0 100644 --- a/graph/loaders/comments.js +++ b/graph/loaders/comments.js @@ -44,16 +44,8 @@ const getCommentsByStatusAndAssetID = (context, {status = null, asset_id = null} }; const getCommentsByActionTypeAndAssetID = (context, {action_type, asset_id = null}) => { - - // TODO: remove when we move the enum over to the uppercase. - if (action_type) { - action_type = action_type.toLowerCase(); - } - return ActionModel.find({ action_type, - - // TODO: remove when we move the enum over to the uppercase. item_type: 'COMMENTS' }).then((actions) => { let comments = CommentModel.find({ diff --git a/graph/loaders/users.js b/graph/loaders/users.js index 793ecfbf9..90c661f71 100644 --- a/graph/loaders/users.js +++ b/graph/loaders/users.js @@ -4,12 +4,9 @@ const util = require('./util'); const UsersService = require('../../services/users'); -const genUserByIDs = (context, ids) => { - console.log('genUserIds', ids); - return UsersService +const genUserByIDs = (context, ids) => UsersService .findByIdArray(ids) .then(util.singleJoinBy(ids, 'id')); -}; /** * Creates a set of loaders based on a GraphQL context. diff --git a/graph/resolvers/action.js b/graph/resolvers/action.js index f82cefdb1..7a93556e0 100644 --- a/graph/resolvers/action.js +++ b/graph/resolvers/action.js @@ -1,16 +1,4 @@ const Action = { - action_type({action_type}) { - - // FIXME: remove once we cast the data model to have uppercase action - // types. - return action_type.toUpperCase(); - }, - item_type({item_type}) { - - // FIXME: remove once we cast the data model to have uppercase item - // types. - return item_type.toUpperCase(); - }, // This will load the user for the specific action. We'll limit this to the // admin users only. diff --git a/graph/resolvers/action_summary.js b/graph/resolvers/action_summary.js index 5a2ef0994..48eff50c7 100644 --- a/graph/resolvers/action_summary.js +++ b/graph/resolvers/action_summary.js @@ -1,16 +1,3 @@ -const ActionSummary = { - action_type({action_type}) { - - // FIXME: remove once we cast the data model to have uppercase action - // types. - return action_type.toUpperCase(); - }, - item_type({item_type}) { - - // FIXME: remove once we cast the data model to have uppercase item - // types. - return item_type.toUpperCase(); - } -}; +const ActionSummary = {}; module.exports = ActionSummary;