no message
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user