Take only objects for the events list

This commit is contained in:
Alfredo Sumaran 2016-11-22 20:04:57 -05:00
parent c52f3d1ca0
commit 0a1f519c2a
1 changed files with 6 additions and 2 deletions

View File

@ -62,9 +62,11 @@
this.state.events = this.decorateEvents(events);
},
decorateEvents(events) {
const newEvents = events;
const newEvents = [];
events.forEach((item) => {
if (!item) return;
newEvents.forEach((item) => {
item.totalTime = item.total_time;
item.author.webUrl = item.author.web_url;
item.author.avatarUrl = item.author.avatar_url;
@ -79,6 +81,8 @@
delete item.created_at;
delete item.short_sha;
delete item.commit_url;
newEvents.push(item);
});
return newEvents;