Fixes to consts + services

This commit is contained in:
Wyatt Johnson
2017-01-24 13:27:22 -07:00
parent 88ed6ffe76
commit 9dc57c82d1
6 changed files with 3 additions and 41 deletions
-3
View File
@@ -1,3 +0,0 @@
language: node_js
node_js:
- 4
+1
View File
@@ -3,6 +3,7 @@ machine:
version: 7
services:
- docker
- redis
test:
override:
-8
View File
@@ -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({
+1 -4
View File
@@ -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.
-12
View File
@@ -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.
+1 -14
View File
@@ -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;