From ac020462ae9f45995e0764de81a4ddb61752ca3c Mon Sep 17 00:00:00 2001 From: Adhidarma Hadiwinoto <me@adhisimon.org> Date: Mon, 4 May 2020 00:33:25 +0700 Subject: [PATCH] Config to disable claim bonus/rebate --- config.sample.json | 3 ++- lib/command-handler/claimbonus.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config.sample.json b/config.sample.json index 9ba00eb..aa6ab6e 100644 --- a/config.sample.json +++ b/config.sample.json @@ -12,5 +12,6 @@ "ascending_deposit": false, "ascending_mutation": false, "blacklist_help_for_origins": [], - "blacklist_help_for_origin_transports": [] + "blacklist_help_for_origin_transports": [], + "disable_claim_bonus": false } \ No newline at end of file diff --git a/lib/command-handler/claimbonus.js b/lib/command-handler/claimbonus.js index e0b7d11..6c811ab 100644 --- a/lib/command-handler/claimbonus.js +++ b/lib/command-handler/claimbonus.js @@ -1,5 +1,7 @@ const coreEndpoint = '/rebate/claim-store'; +const config = require('komodo-sdk/config'); + const commandError = require('./error'); const coreapi = require('../coreapi'); @@ -8,6 +10,14 @@ function help(keyword) { } function execute(tokens, params, cb) { + if (config.disable_claim_bonus || config.disable_claim_rebate) { + const responseParams = { + body: 'Maaf permintaan anda tidak dapat dilakukan', + } + + cb(null, null, responseParams); + return; + } if (!tokens || tokens.length < 2) { const responseParams = { -- 1.9.0