From 5c4cf023bc4bfad2cc0101c57492dd185399c915 Mon Sep 17 00:00:00 2001 From: Adhidarma Hadiwinoto <adhisimon@gmail.com> Date: Mon, 18 Oct 2021 16:46:11 +0700 Subject: [PATCH] Fix eslint on buy.js --- lib/command-handler/buy.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/command-handler/buy.js b/lib/command-handler/buy.js index 51703ba..8db53e0 100644 --- a/lib/command-handler/buy.js +++ b/lib/command-handler/buy.js @@ -18,22 +18,22 @@ function generateRequestId(product, destination) { */ function help() { - return `Untuk pembelian, ketik perintah dengan format: <KODEPRODUK>.<NOMORTUJUAN>.<PIN>`; + return 'Untuk pembelian, ketik perintah dengan format: <KODEPRODUK>.<NOMORTUJUAN>.<PIN>'; } function execute(tokens, params, cb) { if (!tokens || tokens.length < 3) { const responseParams = { - body: `${ commandError.ERR_INVALID_FORMAT }. ${ help() }` - } + body: `${commandError.ERR_INVALID_FORMAT}. ${help()}`, + }; cb(null, null, responseParams); return; } - if (commands[ tokens[0] ] !== 'buy') { + if (commands[tokens[0]] !== 'buy') { tokens.unshift('buy'); - logger.verbose('Rearrange tokens', {tokens: tokens}); + logger.verbose('Rearrange tokens', { tokens }); } const destination = destinationCorrector((tokens[2] || '').trim()); @@ -46,13 +46,12 @@ function execute(tokens, params, cb) { product_name: (tokens[1] || '').trim().toUpperCase(), destination, password: tokens[3], - // request_id: `${generateRequestId(tokens[1], destination)}${Number(tokens[4]) ? '_req' + Number(tokens[4]) : ''}`, - request_id_suffix: tokens[4] || '', - postpaid: 0 + request_id_suffix: tokens[4] || '', + postpaid: 0, }; const coreEndpoint = config.buy_only_prepaid ? coreEndpointBuy : coreEndpointAuto; coreapi(coreEndpoint, coreParams, 'GET', cb); } -module.exports = execute; \ No newline at end of file +module.exports = execute; -- 1.9.0