From 687db7dda864b651422693bb4d07eadfcab4f34a Mon Sep 17 00:00:00 2001 From: Mike Fitzpatrick Date: Sun, 4 Mar 2018 03:26:24 -0500 Subject: [PATCH] no message --- models/profile.js | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/models/profile.js b/models/profile.js index c66bd75..1a40b16 100644 --- a/models/profile.js +++ b/models/profile.js @@ -154,21 +154,15 @@ module.exports = { get: (e, id) => { const promise = new Promise((resolve, reject) => { - ProfileModel.find({ _id: id }) - .populate({ - path: 'messages', - select: 'order text image isUser', - options: { sort: { order: 1 } } - }) - .exec((err, result) => { - if (err) { - reject(err); - } + ProfileModel.find({ _id: id }, (err, result) => { + if (err) { + reject(err); + } - if (result) { - resolve(result); - } - }); + if (result) { + resolve(result); + } + }); }); promise.then((result) => {