update all instances of progressTimestamp to check for objects

This commit is contained in:
Berkeley Martinez
2015-08-07 13:31:48 -07:00
parent e1fb3856c4
commit 71a02ed8b7
4 changed files with 68 additions and 115 deletions

View File

@@ -234,7 +234,9 @@ module.exports = function(app) {
.flatMap(function(user) {
// if user deletes account then this will not exist
if (user) {
user.progressTimestamps.push(Date.now());
user.progressTimestamps.push({
timestamp: Date.now()
});
}
return saveUser(user);
})
@@ -378,7 +380,9 @@ module.exports = function(app) {
return saveInstance(newStory);
});
req.user.progressTimestamps.push(Date.now());
req.user.progressTimestamps.push({
timestamp: Date.now()
});
return saveUser(req.user)
.flatMap(savedStory)
.subscribe(