[next] Perspective API Integration (#1797)

* feat: initial toxic comments impl

* feat: improved logging

* feat: tenant cache adapter

* feat: move more types into graphql
This commit is contained in:
Wyatt Johnson
2018-08-14 14:37:00 +00:00
committed by GitHub
parent d2106b3de5
commit 0b3aead1d2
33 changed files with 1088 additions and 417 deletions
+2 -2
View File
@@ -1,13 +1,13 @@
import { get } from "lodash";
import { KarmaThresholds } from "talk-server/models/settings";
import { GQLKarmaThresholds } from "talk-server/graph/tenant/schema/__generated__/types";
import { User } from "talk-server/models/user";
export const getCommentTrustScore = (user: User): number =>
get(user, "metadata.trust.comment.karma", 0);
export const isReliableCommenter = (
thresholds: KarmaThresholds,
thresholds: GQLKarmaThresholds,
user: User
): boolean | null => {
const score = getCommentTrustScore(user);