no message

This commit is contained in:
2018-03-04 23:13:02 -05:00
parent 9cd338d300
commit 0519e4feff

View File

@@ -114,7 +114,7 @@ ProfileSchema.pre('save', function (next) {
const ProfileModel = Mongoose.model('profiles', ProfileSchema); const ProfileModel = Mongoose.model('profiles', ProfileSchema);
function getChatImages (id, match, callback) { function getChatImages (profileId, match, callback) {
callback = callback || (typeof match === 'function' ? match : function(){}); callback = callback || (typeof match === 'function' ? match : function(){});
match = typeof match === 'object' ? match : {}; match = typeof match === 'object' ? match : {};
match['messages.image'] = { $exists: true }; match['messages.image'] = { $exists: true };
@@ -161,9 +161,9 @@ module.exports = {
}); });
}, },
allMessages: (e, prodileId) => { allMessages: (e, profileId) => {
const promise = new Promise((resolve, reject) => { const promise = new Promise((resolve, reject) => {
ProfileModel.findById(prodileId, (err, result) => { ProfileModel.findById(profileId, (err, result) => {
if (err) { if (err) {
reject(err); reject(err);
} }