go to block using height value. url is: /block-index/<height>
This commit is contained in:
parent
ef0b558ed9
commit
4291af0cc3
@ -10,7 +10,7 @@ var Status = require('../models/Status'),
|
||||
/**
|
||||
* Status
|
||||
*/
|
||||
exports.show = function(req, res, next) {
|
||||
exports.show = function(req, res) {
|
||||
|
||||
if (! req.query.q) {
|
||||
res.status(400).send('Bad Request');
|
||||
|
||||
@ -1,9 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('insight.blocks').controller('BlocksController',
|
||||
function ($scope, $rootScope, $routeParams, $location, Global, Block, Blocks) {
|
||||
function ($scope, $rootScope, $routeParams, $location, Global, Block, Blocks, BlockByHeight) {
|
||||
$scope.global = Global;
|
||||
|
||||
if ($routeParams.blockHeight) {
|
||||
BlockByHeight.get({
|
||||
blockHeight: $routeParams.blockHeight
|
||||
}, function(hash) {
|
||||
$location.path('/block/' + hash.blockHash);
|
||||
}, function() {
|
||||
$rootScope.flashMessage = 'Bad Request';
|
||||
$location.path('/');
|
||||
});
|
||||
}
|
||||
|
||||
$scope.list = function() {
|
||||
Blocks.get({
|
||||
blockDate: $routeParams.blockDate
|
||||
|
||||
Loading…
Reference in New Issue
Block a user