temporarybonus.js
745 Bytes
const coreEndpoint = '/stores/temporary-bonus';
const commandError = require('./error');
const coreapi = require('../coreapi');
function help(keyword) {
return `Untuk mengecek bonus yamg belum dibagikan, ketik perintah dengan format: ${ keyword.toUpperCase() }.<PIN>`;
}
function execute(tokens, params, cb) {
if (!tokens || tokens.length < 2) {
const responseParams = {
body: `${ commandError.ERR_INVALID_FORMAT }. ${ help(tokens[0]) }`
}
cb(null, null, responseParams);
return;
}
const coreParams = {
asker_terminal_name: params.from,
asker_terminal_password: tokens[1],
};
coreapi(coreEndpoint, coreParams, 'GET', cb);
}
module.exports = execute;