feat(archive_todo): Update batchUpdate

This is part 3 of habitrpg#3062. It makes batchUpdate look at the archived flag
not the completed date

Part 1: habitrpg/habitrpg#3302
Part 2: habirrpg/habitrpg-shared#198
This commit is contained in:
Jason Butz 2014-04-18 12:36:22 -04:00
parent 16ac06c4c9
commit 601e94cb43

View file

@ -444,7 +444,7 @@ api.batchUpdate = function(req, res, next) {
}else if(response.wasModified){
// Preen 3-day past-completed To-Dos from Angular & mobile app
response.todos = _.where(response.todos, function(t) {
return !t.completed || (t.challenge && t.challenge.id) || moment(t.dateCompleted).isAfter(moment().subtract('days',3));
return !t.completed || (t.challenge && t.challenge.id) || !t.archived;
});
res.json(200, response);