Skip to content

Commit

Permalink
chore(moderation): prevent null items
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshyx committed May 25, 2022
1 parent 92de91e commit 51dcd7e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/hub/src/datasources/moderation-decision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,17 @@ class ModerationDecisionAPI extends DataSource {
) {
const decisions = await this.listDecisions(delisted, moderated, offset, limit);
const list = [];
console.info('decisions', decisions);
for (const decision of decisions.results) {
// get the full data for each decision
list.push(await this.getFinalDecision(decision.contentID, profileAPI, reportingAPI));
const decisionContent = await this.getFinalDecision(
decision.contentID,
profileAPI,
reportingAPI,
);
if (decisionContent) {
list.push(decisionContent);
}
}
return { results: list, nextIndex: decisions.nextIndex, total: decisions.total };
}
Expand Down

0 comments on commit 51dcd7e

Please sign in to comment.