From de4619689b8f5ea32ec54274c2e44507c6ad24bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 17 Sep 2019 09:12:45 -0400 Subject: [PATCH] fix: change params --- src/rewards/index.js | 3 ++- test/rewards.js | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rewards/index.js b/src/rewards/index.js index 3ccdfee701..825602a8e5 100644 --- a/src/rewards/index.js +++ b/src/rewards/index.js @@ -7,7 +7,8 @@ const plugins = require('../plugins'); const rewards = module.exports; -rewards.checkConditionAndRewardUser = async function (uid, condition, method) { +rewards.checkConditionAndRewardUser = async function (params) { + const { uid, condition, method } = params; const isActive = await isConditionActive(condition); if (!isActive) { return; diff --git a/test/rewards.js b/test/rewards.js index 99b85e0681..bd693ecbc1 100644 --- a/test/rewards.js +++ b/test/rewards.js @@ -66,7 +66,11 @@ describe('rewards', function () { function method(next) { next(null, 1); } - rewards.checkConditionAndRewardUser(adminUid, 'essentials/user.postcount', method, function (err, data) { + rewards.checkConditionAndRewardUser({ + uid: adminUid, + condition: 'essentials/user.postcount', + method: method, + }, function (err, data) { assert.ifError(err); done(); });