mirror of
https://github.com/wassname/talk.git
synced 2026-07-26 13:37:38 +08:00
Q&A Fixes (#2866)
* Fix various Q&A moderation/tagging issues - Allow Staff members to have their questions answered and appropriately tagged - Properly filter answering for only top level questions (comments) - Add documentation around various moderation phases and comment creation steps - Remove unnecessary status filter when setting the status for a comment * fix: abstracted out perspective configs * fix: reworked tag injection * Fix sorting/unused imports Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
This commit is contained in:
co-authored by
Wyatt Johnson
parent
c052d37a6f
commit
769ab2a910
@@ -1,12 +1,10 @@
|
||||
import { Db } from "mongodb";
|
||||
|
||||
import { Config } from "coral-server/config";
|
||||
import { CoralEventPublisherBroker } from "coral-server/events/publisher";
|
||||
import { hasTag } from "coral-server/models/comment";
|
||||
import { Tenant } from "coral-server/models/tenant";
|
||||
import { removeTag } from "coral-server/services/comments";
|
||||
import { moderate } from "coral-server/services/comments/moderation";
|
||||
import { notifyPerspectiveModerationDecision } from "coral-server/services/perspective";
|
||||
import { AugmentedRedis } from "coral-server/services/redis";
|
||||
|
||||
import {
|
||||
@@ -19,7 +17,6 @@ import { publishChanges, updateAllCommentCounts } from "./helpers";
|
||||
const rejectComment = async (
|
||||
mongo: Db,
|
||||
redis: AugmentedRedis,
|
||||
config: Config,
|
||||
broker: CoralEventPublisherBroker | null,
|
||||
tenant: Tenant,
|
||||
commentID: string,
|
||||
@@ -56,6 +53,7 @@ const rejectComment = async (
|
||||
...result,
|
||||
...counts,
|
||||
moderatorID,
|
||||
commentRevisionID,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -64,18 +62,6 @@ const rejectComment = async (
|
||||
return removeTag(mongo, tenant, result.after.id, GQLTAG.FEATURED);
|
||||
}
|
||||
|
||||
// We don't want to await on this so that
|
||||
// we don't hold up the moderation flow and response
|
||||
notifyPerspectiveModerationDecision(
|
||||
mongo,
|
||||
tenant,
|
||||
config,
|
||||
tenant.integrations.perspective,
|
||||
result.after,
|
||||
commentRevisionID,
|
||||
GQLCOMMENT_STATUS.REJECTED
|
||||
);
|
||||
|
||||
// Return the resulting comment.
|
||||
return result.after;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user