mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-16 17:02:18 +00:00
fix(notifications): check for group id to be sent with seenMessage
This commit is contained in:
parent
1067c82418
commit
a9f80bd860
1 changed files with 6 additions and 3 deletions
|
|
@ -254,9 +254,12 @@ api.deleteChatMessage = function(req, res, next){
|
|||
|
||||
api.seenMessage = function(req,res,next){
|
||||
// Skip the auth step, we want this to be fast. If !found with uuid/token, then it just doesn't save
|
||||
var update = {$set:{}};
|
||||
update['$set']['newMessages.'+req.params.gid+'.value'] = false;
|
||||
User.update({_id:req.headers['x-api-user'], apiToken:req.headers['x-api-key']},update).exec();
|
||||
// Check for req.params.gid to exist
|
||||
if(req.params.gid){
|
||||
var update = {$set:{}};
|
||||
update['$set']['newMessages.'+req.params.gid+'.value'] = false;
|
||||
User.update({_id:req.headers['x-api-user'], apiToken:req.headers['x-api-key']},update).exec();
|
||||
}
|
||||
res.send(200);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue