Commit af2522550cfc04463110f7c0fc343c64724aea3b
1 parent
761e213ec4
Exists in
master
JSDOC router-ussd
Showing 1 changed file with 9 additions and 3 deletions Side-by-side Diff
lib/http-command-server/router-ussd.js
... | ... | @@ -7,7 +7,14 @@ const modem = require('../modem'); |
7 | 7 | const router = express.Router(); |
8 | 8 | module.exports = router; |
9 | 9 | |
10 | - | |
10 | +/** | |
11 | + * Eksekusi kode USSD | |
12 | + * @param {object} req - Objek request Express | |
13 | + * @param {object} req.query - Objek query string request Express | |
14 | + * @param {string} req.query.code - Kode USSD yang ingin dieksekusi | |
15 | + * @param {number} [req.query.include_cusd2=0] - Apakah ingin mengeksekusi CUSD=2 secara otomatis. 0: tidak (DEFAULT), 1: sesudah eksekusi ussd, -1: sebelum ekseksi ussd. | |
16 | + * @param {object} res - Objek respon Express | |
17 | + */ | |
11 | 18 | async function handlerIndex(req, res) { |
12 | 19 | if (!req.query || !req.query.code || typeof req.query.code !== 'string') { |
13 | 20 | res.json({ |
... | ... | @@ -25,8 +32,7 @@ async function handlerIndex(req, res) { |
25 | 32 | error: false, |
26 | 33 | code: req.query.code, |
27 | 34 | include_cusd2: req.query.include_cusd2, |
28 | - result: reply, | |
29 | - message: 'USSD executed', | |
35 | + message: reply, | |
30 | 36 | }); |
31 | 37 | } |
32 | 38 |