Skip to content

Commit

Permalink
Merge pull request #65 from linnovate/fix-projects-by-discussion
Browse files Browse the repository at this point in the history
Add adtional check to filter out null values
  • Loading branch information
roman-holovin committed Nov 9, 2015
2 parents 8601462 + 7cfd709 commit 81a9440
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/custom/icapi/server/controllers/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ exports.defaultOptions = options;
var crud = require('../controllers/crud.js');
var projectController = crud('projects', options);

var utils = require('./utils'),
mongoose = require('mongoose'),
var mongoose = require('mongoose'),
Project = mongoose.model('Project'),
Task = mongoose.model('Task'),
User = mongoose.model('User'),
Expand Down Expand Up @@ -120,7 +119,7 @@ exports.getByDiscussion = function (req, res, next) {

var entityQuery = {
discussions: req.params.id,
project: {$ne: null}
project: { $and: [{ $ne: null }, { $exists: 'project' }] }
};

var starredOnly = false;
Expand Down

0 comments on commit 81a9440

Please sign in to comment.