From 746dc328ab759d95935177834525b4a1dfccffff Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 30 Sep 2014 02:53:34 -0400 Subject: forgot $in --- server/lib/views/staff.js | 6 +++--- views/staff/_projects.ejs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/server/lib/views/staff.js b/server/lib/views/staff.js index ffacee2..41877c8 100644 --- a/server/lib/views/staff.js +++ b/server/lib/views/staff.js @@ -143,14 +143,14 @@ var staff = module.exports = { }, ensureObjectsUsers: function(objects, next){ - if (! objects) { return next () } + if (! objects) { return next () } var dedupe = {}, user_ids objects.forEach(function(obj){ dedupe[ obj.user_id ] = dedupe[ obj.user_id ] || [] dedupe[ obj.user_id ].push(obj) }) user_ids = _.keys(dedupe) - User.find({ _id: user_ids }) + User.find({ _id: { $in: user_ids } }) .select(staff.fields.user) .exec(function (err, users) { if (! users) { return next () } @@ -527,4 +527,4 @@ var staff = module.exports = { }, } -} \ No newline at end of file +} diff --git a/views/staff/_projects.ejs b/views/staff/_projects.ejs index 0fdfcf5..2c3eb9f 100644 --- a/views/staff/_projects.ejs +++ b/views/staff/_projects.ejs @@ -7,11 +7,10 @@ [view] [edit] + [api] - [[ if (project.user) { ]] [[- project.user.username ]] - [[ } ]] [[- project.date ]] -- cgit v1.2.3-70-g09d2