mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 13:20:41 +01:00
fix: change params
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user