Skip to content

Commit

Permalink
fix: fixed data leak on investors interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
AndySakov committed Oct 9, 2023
1 parent 93ae874 commit dd4abc2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/shared/entities/all-jobs-list-result.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ export class AllJobListResultEntity {
website: notStringOrNull(organization?.website),
createdTimestamp: nonZeroOrNull(organization?.createdTimestamp),
updatedTimestamp: nonZeroOrNull(organization?.updatedTimestamp),
investors:
organization?.investors.map(investor => ({
id: investor.id,
name: investor.name,
})) ?? [],
fundingRounds:
organization?.fundingRounds
.map(fr => ({
...fr,
raisedAmount: nonZeroOrNull(fr?.raisedAmount),
createdTimestamp: nonZeroOrNull(fr?.createdTimestamp),
roundName: notStringOrNull(fr?.roundName),
sourceLink: notStringOrNull(fr?.sourceLink),
}))
.sort((a, b) => b.date - a.date) ?? [],
},
tags: tags ?? [],
});
Expand Down
6 changes: 5 additions & 1 deletion src/shared/entities/job-list-result.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ export class JobListResultEntity {
sourceLink: notStringOrNull(fr?.sourceLink),
}))
.sort((a, b) => b.date - a.date) ?? [],
investors: organization?.investors ?? [],
investors:
organization?.investors.map(investor => ({
id: investor.id,
name: investor.name,
})) ?? [],
},
tags: tags ?? [],
});
Expand Down

0 comments on commit dd4abc2

Please sign in to comment.