From edbc9325462ddf4536775871ebc25e06f46612d1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Jul 2020 15:05:51 +0200 Subject: Add server API to abuse messages --- shared/models/moderation/abuse/abuse-message.model.ts | 9 +++++++++ shared/models/moderation/abuse/abuse.model.ts | 19 ++++++++++++++----- shared/models/moderation/abuse/index.ts | 1 + 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 shared/models/moderation/abuse/abuse-message.model.ts (limited to 'shared/models/moderation/abuse') diff --git a/shared/models/moderation/abuse/abuse-message.model.ts b/shared/models/moderation/abuse/abuse-message.model.ts new file mode 100644 index 000000000..02072d5ce --- /dev/null +++ b/shared/models/moderation/abuse/abuse-message.model.ts @@ -0,0 +1,9 @@ +import { AccountSummary } from '@shared/models' + +export interface AbuseMessage { + id: number + message: string + byModerator: boolean + + account: AccountSummary +} diff --git a/shared/models/moderation/abuse/abuse.model.ts b/shared/models/moderation/abuse/abuse.model.ts index 0a0c6bd35..7f126ba4a 100644 --- a/shared/models/moderation/abuse/abuse.model.ts +++ b/shared/models/moderation/abuse/abuse.model.ts @@ -4,7 +4,7 @@ import { AbusePredefinedReasonsString } from './abuse-reason.model' import { VideoConstant } from '../../videos/video-constant.model' import { VideoChannel } from '../../videos/channel/video-channel.model' -export interface VideoAbuse { +export interface AdminVideoAbuse { id: number name: string uuid: string @@ -23,7 +23,7 @@ export interface VideoAbuse { nthReport: number } -export interface VideoCommentAbuse { +export interface AdminVideoCommentAbuse { id: number threadId: number @@ -38,7 +38,7 @@ export interface VideoCommentAbuse { deleted: boolean } -export interface Abuse { +export interface AdminAbuse { id: number reason: string @@ -50,8 +50,8 @@ export interface Abuse { state: VideoConstant moderationComment?: string - video?: VideoAbuse - comment?: VideoCommentAbuse + video?: AdminVideoAbuse + comment?: AdminVideoCommentAbuse createdAt: Date updatedAt: Date @@ -59,6 +59,8 @@ export interface Abuse { countReportsForReporter?: number countReportsForReportee?: number + countMessages: number + // FIXME: deprecated in 2.3, remove the following properties // @deprecated @@ -71,3 +73,10 @@ export interface Abuse { // @deprecated nth?: number } + +export type UserVideoAbuse = Omit + +export type UserVideoCommentAbuse = AdminVideoCommentAbuse + +export type UserAbuse = Omit diff --git a/shared/models/moderation/abuse/index.ts b/shared/models/moderation/abuse/index.ts index 55046426a..b518517a6 100644 --- a/shared/models/moderation/abuse/index.ts +++ b/shared/models/moderation/abuse/index.ts @@ -1,5 +1,6 @@ export * from './abuse-create.model' export * from './abuse-filter.type' +export * from './abuse-message.model' export * from './abuse-reason.model' export * from './abuse-state.model' export * from './abuse-update.model' -- cgit v1.2.3