Commit 8d57793ce99d3969026929a8424a16422b3382e0

Authored by Adhidarma Hadiwinoto
1 parent b59804e78b
Exists in master

typo fix again

Showing 1 changed file with 1 additions and 1 deletions Inline Diff

lib/modem-dashboard/router-stocks.js
1 "use strict"; 1 "use strict";
2 2
3 const express = require('express'); 3 const express = require('express');
4 const router = express.Router(); 4 const router = express.Router();
5 module.exports = router; 5 module.exports = router;
6 6
7 const matrix = require('komodo-sdk/matrix'); 7 const matrix = require('komodo-sdk/matrix');
8 8
9 function pageIndex(req, res, next) { 9 function pageIndex(req, res, next) {
10 let stocks_array; 10 let stocks_array;
11 11
12 if (!matrix || !matrix.stock || (typeof matrix.stock !== 'object')) { 12 if (!matrix || !matrix.stock || (typeof matrix.stock !== 'object')) {
13 stocks_array = null; 13 stocks_array = null;
14 } 14 }
15 15
16 for (let key in matrix.stock) { 16 for (let key in matrix.stock) {
17 if (matrix.stock.hasOwnProperty(key)) { 17 if (matrix.stock.hasOwnProperty(key)) {
18 stocks_array.push({ 18 stocks_array.push({
19 name: key, 19 name: key,
20 balance: matrix.stock[key] 20 balance: matrix.stock[key]
21 }); 21 });
22 } 22 }
23 } 23 }
24 24
25 res.render( 25 res.render(
26 'stocks.html', 26 'stocks.html',
27 { 27 {
28 page_title: 'Stock' 28 page_title: 'Stock',
29 stocks_array: stocks_array 29 stocks_array: stocks_array
30 } 30 }
31 ); 31 );
32 32
33 } 33 }
34 34
35 router.get('/', pageIndex); 35 router.get('/', pageIndex);
36 36