Skip to content
Permalink
Browse files

closes #2916

  • Loading branch information
psychobunny committed Apr 1, 2015
1 parent 7161972 commit 4a9498e105441557d9d99453c8141c297a7edfbd
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/rewards/admin.js
@@ -15,7 +15,7 @@ rewards.save = function(data, callback) {

data.id = id;

async.waterfall([
async.series([
function(next) {
rewards.delete(data, next);
},
@@ -97,7 +97,7 @@ function saveConditions(data, callback) {
db.setAdd('conditions:active', conditions, callback);

async.each(Object.keys(rewardsPerCondition), function(condition, next) {
db.setAdd('condition:' + condition + ':rewards', rewardsPerCondition[condition]);
db.setAdd('condition:' + condition + ':rewards', rewardsPerCondition[condition], next);
}, callback);
});
}
@@ -114,8 +114,10 @@ function getActiveRewards(callback) {
db.getObject('rewards:id:' + id + ':rewards', next);
}
}, function(err, data) {
data.main.rewards = data.rewards;
activeRewards.push(data.main);
if (data.main) {
data.main.rewards = data.rewards;
activeRewards.push(data.main);
}

next(err);
});

0 comments on commit 4a9498e

Please sign in to comment.
You can’t perform that action at this time.