fixed syntax javascript warnings
This commit is contained in:
parent
6c3968869b
commit
906cd019c7
|
@ -5,12 +5,11 @@
|
|||
*/
|
||||
|
||||
var Status = require('../models/Status');
|
||||
var async = require('async');
|
||||
|
||||
/**
|
||||
* Status
|
||||
*/
|
||||
exports.show = function(req, res) {
|
||||
exports.show = function(req, res, next) {
|
||||
|
||||
if (! req.query.q) {
|
||||
res.status(400).send('Bad Request');
|
||||
|
@ -19,25 +18,25 @@ exports.show = function(req, res) {
|
|||
var s = req.query.q;
|
||||
var d = Status.new();
|
||||
|
||||
if (s == 'getInfo') {
|
||||
if (s === 'getInfo') {
|
||||
d.getInfo(function(err) {
|
||||
if (err) next(err);
|
||||
res.jsonp(d);
|
||||
});
|
||||
}
|
||||
else if (s == 'getDifficulty') {
|
||||
else if (s === 'getDifficulty') {
|
||||
d.getDifficulty(function(err) {
|
||||
if (err) next(err);
|
||||
res.jsonp(d);
|
||||
});
|
||||
}
|
||||
else if (s == 'getTxOutSetInfo') {
|
||||
else if (s === 'getTxOutSetInfo') {
|
||||
d.getTxOutSetInfo(function(err) {
|
||||
if (err) next(err);
|
||||
res.jsonp(d);
|
||||
});
|
||||
}
|
||||
else if (s == 'getBestBlockHash') {
|
||||
else if (s === 'getBestBlockHash') {
|
||||
d.getBestBlockHash(function(err) {
|
||||
if (err) next(err);
|
||||
res.jsonp(d);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
var app = angular.module('mystery',
|
||||
angular.module('mystery',
|
||||
['ngAnimate',
|
||||
'ngCookies',
|
||||
'ngResource',
|
||||
|
|
|
@ -7,16 +7,16 @@ angular.module('mystery.status').controller('StatusController', ['$scope', '$rou
|
|||
Status.get({
|
||||
q: q
|
||||
}, function(d) {
|
||||
if (q == 'getInfo') {
|
||||
if (q === 'getInfo') {
|
||||
$scope.info = d.info;
|
||||
}
|
||||
if (q == 'getDifficulty') {
|
||||
if (q === 'getDifficulty') {
|
||||
$scope.difficulty = d.difficulty;
|
||||
}
|
||||
if (q == 'getTxOutSetInfo') {
|
||||
if (q === 'getTxOutSetInfo') {
|
||||
$scope.txoutsetinfo = d.txoutsetinfo;
|
||||
}
|
||||
if (q == 'getBestBlockHash') {
|
||||
if (q === 'getBestBlockHash') {
|
||||
$scope.bestblockhash = d.bestblockhash;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue