Skip to content

Commit

Permalink
Merge pull request #77 from ltonetwork/OwnablesKeywords
Browse files Browse the repository at this point in the history
Update EventChain.service.ts
  • Loading branch information
stiemsdev authored May 31, 2024
2 parents b29d096 + d46950e commit b51d8d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/services/EventChain.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export default class EventChainService {
.filter((name) => name.match(/^ownable:\w+$/))
.map((name) => name.replace(/^ownable:(\w+)$/, "$1"));

return (await Promise.all(ids.map((id) => this.load(id)))).sort(
({ created: a }, { created: b }) => a.getTime() - b.getTime()
);
return (await Promise.all(ids.map(async id => {
const { chain, package: packageCid, created, keywords} = await this.load(id);
return { chain, package: packageCid, created, keywords };
}))).sort(({created: a}, {created: b}) => a.getTime() - b.getTime());
}

static async load(id: string): Promise<{chain: EventChain, package: string, created: Date, keywords: string[]}> {
Expand Down

0 comments on commit b51d8d7

Please sign in to comment.