mirror of
https://github.com/wassname/talk.git
synced 2026-08-15 12:55:10 +08:00
Fixes to consts + services
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 4
|
||||
@@ -3,6 +3,7 @@ machine:
|
||||
version: 7
|
||||
services:
|
||||
- docker
|
||||
- redis
|
||||
|
||||
test:
|
||||
override:
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
Reference in New Issue
Block a user