Skip to content

Commit

Permalink
updateOneMessagesToRead
Browse files Browse the repository at this point in the history
  • Loading branch information
alsotang committed Apr 11, 2017
1 parent 6264f8b commit bc2a9b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/v1/message.js
Expand Up @@ -85,7 +85,7 @@ var markOne = function (req, res, next) {
var msg_id = req.params.msg_id;
var ep = new eventproxy();
ep.fail(next);
Message.updateMessagesToRead(msg_id, ep.done('marked_result', function (result) {
Message.updateOneMessagesToRead(msg_id, ep.done('marked_result', function (result) {
return result;
}));

Expand Down
4 changes: 2 additions & 2 deletions proxy/message.js
Expand Up @@ -107,11 +107,11 @@ exports.updateMessagesToRead = function (userId, messages, callback) {
/**
* 将单个消息设置成已读
*/
exports.updateMessagesToRead = function (msg_id, callback) {
exports.updateOneMessagesToRead = function (msg_id, callback) {
callback = callback || _.noop;
if (!msg_id) {
return callback();
}
var query = { _id: msg_id };
Message.update(query, { $set: { has_read: true } }, { multi: true }).exec(callback);
};
};

0 comments on commit bc2a9b5

Please sign in to comment.