diff --git a/src/entity/SourcePostModeration.ts b/src/entity/SourcePostModeration.ts index f86c71cf6a..00d7d58f48 100644 --- a/src/entity/SourcePostModeration.ts +++ b/src/entity/SourcePostModeration.ts @@ -52,6 +52,7 @@ export enum WarningReason { } export type SourcePostModerationFlags = Partial<{ + aiModerated: boolean; vordr: boolean; warningReason: WarningReason; dedupKey: string; diff --git a/src/schema/posts.ts b/src/schema/posts.ts index 384c59463c..78edd7a054 100644 --- a/src/schema/posts.ts +++ b/src/schema/posts.ts @@ -1744,6 +1744,10 @@ export const typeDefs = /* GraphQL */ ` Moderator message for the post """ moderatorMessage: String + """ + Whether this moderation decision was made by AI + """ + aiModerated: Boolean ): [SourcePostModeration]! @auth """ @@ -3120,12 +3124,13 @@ export const resolvers: IResolvers = { status, rejectionReason = null, moderatorMessage = null, + aiModerated = false, }: { postIds: string[]; } & Pick< SourcePostModeration, 'sourceId' | 'status' | 'rejectionReason' | 'moderatorMessage' - >, + > & { aiModerated?: boolean }, ctx: AuthContext, info, ) => { @@ -3177,6 +3182,12 @@ export const resolvers: IResolvers = { update.moderatorMessage = moderatorMessage; } + if (aiModerated) { + update.flags = updateFlagsStatement({ + aiModerated: true, + }); + } + await ctx.con .getRepository(SourcePostModeration) .update(