[CORL-882] option to reject all a user's comments when banning (#2827)

* show comment counts for stories in story table

* remove debug code

* add rejector task

* connect comment rejection job to user banning

* localize strings

* remove debug code

* remove debug code

* resolve merge conflicts

* add documentation to rejectExistingComments

* clean up rejector task

* add TODO about broker

* make rejectExistingComments nullable
This commit is contained in:
Tessa Thornton
2020-02-21 12:38:40 -05:00
committed by GitHub
parent ca52cc3253
commit d6db287c55
24 changed files with 491 additions and 120 deletions
+11 -7
View File
@@ -20,7 +20,7 @@ const rejectComment = async (
mongo: Db,
redis: AugmentedRedis,
config: Config,
broker: CoralEventPublisherBroker,
broker: CoralEventPublisherBroker | null,
tenant: Tenant,
commentID: string,
commentRevisionID: string,
@@ -48,12 +48,16 @@ const rejectComment = async (
actionCounts: {},
});
// Publish changes to the event publisher.
await publishChanges(broker, {
...result,
...counts,
moderatorID,
});
// TODO: (wyattjoh) (tessalt) broker cannot easily be passed to stack from tasks,
// see CORL-935 in jira
if (broker) {
// Publish changes to the event publisher.
await publishChanges(broker, {
...result,
...counts,
moderatorID,
});
}
// If there was a featured tag on this comment, remove it.
if (hasTag(result.after, GQLTAG.FEATURED)) {