Skip to content

Node.js based forum software built for the modern web

fix: change params

Barış Soner Uşaklıde4619689b8f
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();
});