Commit 5c4cf023bc4bfad2cc0101c57492dd185399c915

Authored by Adhidarma Hadiwinoto
1 parent 8d90a3941f
Exists in master

Fix eslint on buy.js

Showing 1 changed file with 8 additions and 9 deletions Side-by-side Diff

lib/command-handler/buy.js
... ... @@ -18,22 +18,22 @@ function generateRequestId(product, destination) {
18 18 */
19 19  
20 20 function help() {
21   - return `Untuk pembelian, ketik perintah dengan format: <KODEPRODUK>.<NOMORTUJUAN>.<PIN>`;
  21 + return 'Untuk pembelian, ketik perintah dengan format: <KODEPRODUK>.<NOMORTUJUAN>.<PIN>';
22 22 }
23 23  
24 24 function execute(tokens, params, cb) {
25 25 if (!tokens || tokens.length < 3) {
26 26 const responseParams = {
27   - body: `${ commandError.ERR_INVALID_FORMAT }. ${ help() }`
28   - }
  27 + body: `${commandError.ERR_INVALID_FORMAT}. ${help()}`,
  28 + };
29 29  
30 30 cb(null, null, responseParams);
31 31 return;
32 32 }
33 33  
34   - if (commands[ tokens[0] ] !== 'buy') {
  34 + if (commands[tokens[0]] !== 'buy') {
35 35 tokens.unshift('buy');
36   - logger.verbose('Rearrange tokens', {tokens: tokens});
  36 + logger.verbose('Rearrange tokens', { tokens });
37 37 }
38 38  
39 39 const destination = destinationCorrector((tokens[2] || '').trim());
... ... @@ -46,13 +46,12 @@ function execute(tokens, params, cb) {
46 46 product_name: (tokens[1] || '').trim().toUpperCase(),
47 47 destination,
48 48 password: tokens[3],
49   - // request_id: `${generateRequestId(tokens[1], destination)}${Number(tokens[4]) ? '_req' + Number(tokens[4]) : ''}`,
50   - request_id_suffix: tokens[4] || '',
51   - postpaid: 0
  49 + request_id_suffix: tokens[4] || '',
  50 + postpaid: 0,
52 51 };
53 52  
54 53 const coreEndpoint = config.buy_only_prepaid ? coreEndpointBuy : coreEndpointAuto;
55 54 coreapi(coreEndpoint, coreParams, 'GET', cb);
56 55 }
57 56  
58   -module.exports = execute;
59 57 \ No newline at end of file
  58 +module.exports = execute;