insight-ui-dash
Version:
An open-source frontend for the Insight API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the Dash network and build your own services with it.
32 lines (30 loc) • 735 B
JavaScript
module('insight.blocks')
.factory('Block',
function($resource) {
return $resource(window.apiPrefix + '/block/:blockHash', {
blockHash: '@blockHash'
}, {
get: {
method: 'GET',
interceptor: {
response: function (res) {
return res.data;
},
responseError: function (res) {
if (res.status === 404) {
return res;
}
}
}
}
});
})
.factory('Blocks',
function($resource) {
return $resource(window.apiPrefix + '/blocks');
})
.factory('BlockByHeight',
function($resource) {
return $resource(window.apiPrefix + '/block-index/:blockHeight');
});
;
angular.