Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonSharratt committed Feb 3, 2020
1 parent 27bdd4f commit 29d3ac4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions microservices/requestApi/db/model/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ model.getAll = function(query, limit, page, user, callback){
logger.verbose("in topic bind");
if (results){
for (var i=0; i<results.length; i++){
if (typeof(results[i]) !== "undefined"){
if ( (typeof(results[i]) !== "undefined") && (typeof(results[i].topic) !== "undefined") ){
let topicId = results[i].topic;
results[i].projects = projectR.get(topicId);
}
Expand All @@ -417,7 +417,9 @@ model.getAll = function(query, limit, page, user, callback){

if ('_id' in query) {
db.Request.findById(query['_id'], (err3, req) => {
getAllTopics(user, { id: req.topic }, queryRequests);
if ( (typeof(req) !== "undefined") && (typeof(req.topic) !== "undefined") ){
getAllTopics(user, { id: req.topic }, queryRequests);
}
});
} else {
getAllTopics(user, {}, queryRequests);
Expand Down

0 comments on commit 29d3ac4

Please sign in to comment.