Skip to content

Commit

Permalink
Build 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorizzo committed Sep 16, 2019
1 parent 6f290c6 commit 00a11ad
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [1.0.2] - 2019-09-16

### Fixed

- api/modules/Event.getEventsByAddress, addressData

## [1.0.1] - 2019-09-11

## Changed
Expand Down
20 changes: 11 additions & 9 deletions dist/api/modules/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class Event extends _DataCollector.DataCollectorItem {
constructor(collections, key) {
// const sortable = { timestamp: -1 }
const { Events, Addrs } = collections;
const { Events } = collections;
super(Events, key);
this.publicActions = {
/**
Expand Down Expand Up @@ -108,14 +108,16 @@ class Event extends _DataCollector.DataCollectorItem {
if (res.data) {
let addresses = new Set(res.data.map(d => d.address));
addresses = [...addresses.values()];

let addrData = await Addrs.find({ address: { $in: addresses } });
let { data } = addrData;
if (data) {
res.data = res.data.map(d => {
d._addressData = data.find(a => a.address === d.address);
return d;
});
let AddressModule = this.parent.getModule('Address');
if (AddressModule) {
let addrData = await AddressModule.find({ address: { $in: addresses } });
let { data } = addrData;
if (data) {
res.data = res.data.map(d => {
d._addressData = data.find(a => a.address === d.address);
return d;
});
}
}
}
return res;
Expand Down
2 changes: 1 addition & 1 deletion dist/api/modules/Token.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var _utils = require("../../lib/utils");
var _bignumber = require("bignumber.js");

class Token extends _DataCollector.DataCollectorItem {
constructor({ TokensAddrs, Addrs }, key) {
constructor({ TokensAddrs }, key) {
super(TokensAddrs, key);
this.publicActions = {
/**
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rsk-explorer-api",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/swagger.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"info": {
"title": "rsk-explorer-api",
"version": "1.0.1",
"version": "1.0.2",
"description": "explorer API Documentation"
},
"swagger": "2.0",
Expand Down

0 comments on commit 00a11ad

Please sign in to comment.