Commit 558708432aa9461bd16ae6121b95503348c86650
1 parent
7792c4ae0d
Exists in
master
Some eslint
Showing 2 changed files with 13 additions and 16 deletions Side-by-side Diff
lib/command-handler/daysummary.js
1 | -"use strict"; | |
2 | - | |
3 | 1 | const coreEndpoint = '/stores/summary'; |
4 | 2 | |
5 | 3 | const commandError = require('./error'); |
6 | 4 | const coreapi = require('../coreapi'); |
7 | 5 | |
8 | 6 | function help(keyword) { |
9 | - return `Untuk melihat laporan harian, ketik perintah dengan format: ${ keyword.toUpperCase() }.<PIN> atau ${ keyword.toUpperCase() }.<TANGGAL>.<PIN>. Format tanggal YYYY-MM-DD, contoh 2018-12-31 untuk tanggal 31 Desember 2018.`; | |
7 | + return `Untuk melihat laporan harian, ketik perintah dengan format: ${keyword.toUpperCase()}.<PIN> atau ${keyword.toUpperCase()}.<TANGGAL>.<PIN>. Format tanggal YYYY-MM-DD, contoh 2018-12-31 untuk tanggal 31 Desember 2018.`; | |
10 | 8 | } |
11 | 9 | |
12 | 10 | function execute(tokens, params, cb) { |
13 | - | |
14 | 11 | if (!tokens || tokens.length < 2) { |
15 | 12 | const responseParams = { |
16 | - body: `${ commandError.ERR_INVALID_FORMAT }. ${ help(tokens[0]) }` | |
17 | - } | |
13 | + body: `${commandError.ERR_INVALID_FORMAT}. ${help(tokens[0])}`, | |
14 | + }; | |
18 | 15 | |
19 | 16 | cb(null, null, responseParams); |
20 | 17 | return; |
... | ... | @@ -33,4 +30,4 @@ function execute(tokens, params, cb) { |
33 | 30 | coreapi(coreEndpoint, coreParams, 'GET', cb); |
34 | 31 | } |
35 | 32 | |
36 | -module.exports = execute; | |
37 | 33 | \ No newline at end of file |
34 | +module.exports = execute; |
lib/command-handler/listtrx.js
... | ... | @@ -6,7 +6,11 @@ const commandError = require('./error'); |
6 | 6 | const coreapi = require('../coreapi'); |
7 | 7 | |
8 | 8 | function help(keyword, commandGroup) { |
9 | - return `Untuk melihat list transaksi${ commandGroup === 'listtrxall' ? ' termasuk downline': ''}, ketik perintah dengan format: ${ keyword.toUpperCase() }.<PIN> atau ${ keyword.toUpperCase() }.<TANGGAL>.<PIN>. Format tanggal YYYY-MM-DD, contoh 2018-12-31 untuk tanggal 31 Desember 2018.`; | |
9 | + return `Untuk melihat list transaksi${ | |
10 | + commandGroup === 'listtrxall' | |
11 | + ? ' termasuk downline' | |
12 | + : '' | |
13 | + }, ketik perintah dengan format: ${keyword.toUpperCase()}.<PIN> atau ${keyword.toUpperCase()}.<TANGGAL>.<PIN>. Format tanggal YYYY-MM-DD, contoh 2018-12-31 untuk tanggal 31 Desember 2018.`; | |
10 | 14 | } |
11 | 15 | |
12 | 16 | module.exports = (tokens, params, cb) => { |
... | ... | @@ -16,21 +20,17 @@ module.exports = (tokens, params, cb) => { |
16 | 20 | |
17 | 21 | if (blacklisted) { |
18 | 22 | const body = `Perintah "${tokens[0]}" tdk tersedia pd jalur SMS dan sejenis.`; |
19 | - const responseParams = { | |
20 | - body | |
21 | - } | |
22 | - | |
23 | + const responseParams = { body }; | |
24 | + | |
23 | 25 | cb(null, null, responseParams); |
24 | 26 | return; |
25 | 27 | } |
26 | 28 | } |
27 | - | |
28 | - | |
29 | 29 | |
30 | 30 | if (!tokens || tokens.length < 2) { |
31 | 31 | const responseParams = { |
32 | - body: `${ commandError.ERR_INVALID_FORMAT }. ${ help(tokens[0], params.commandGroup) }` | |
33 | - } | |
32 | + body: `${commandError.ERR_INVALID_FORMAT}. ${help(tokens[0], params.commandGroup)}`, | |
33 | + }; | |
34 | 34 | |
35 | 35 | cb(null, null, responseParams); |
36 | 36 | return; |