no message
This commit is contained in:
@@ -154,21 +154,15 @@ module.exports = {
|
|||||||
|
|
||||||
get: (e, id) => {
|
get: (e, id) => {
|
||||||
const promise = new Promise((resolve, reject) => {
|
const promise = new Promise((resolve, reject) => {
|
||||||
ProfileModel.find({ _id: id })
|
ProfileModel.find({ _id: id }, (err, result) => {
|
||||||
.populate({
|
if (err) {
|
||||||
path: 'messages',
|
reject(err);
|
||||||
select: 'order text image isUser',
|
}
|
||||||
options: { sort: { order: 1 } }
|
|
||||||
})
|
|
||||||
.exec((err, result) => {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
promise.then((result) => {
|
promise.then((result) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user