X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fabuse%2Fabuse.ts;h=4c6a96a86d3f882c0afd06ca5035aa2118d8f3d9;hb=77239b425a8e00822a53c9907415832a473c3eb6;hp=3518f5c02983b227554391b313d5845f480dc633;hpb=819b656439e5f0ec2ae5de9357502cdfe3196197;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.ts index 3518f5c02..4c6a96a86 100644 --- a/server/models/abuse/abuse.ts +++ b/server/models/abuse/abuse.ts @@ -16,7 +16,7 @@ import { UpdatedAt } from 'sequelize-typescript' import { isAbuseModerationCommentValid, isAbuseReasonValid, isAbuseStateValid } from '@server/helpers/custom-validators/abuses' -import { abusePredefinedReasonsMap, AttributesOnly } from '@shared/core-utils' +import { abusePredefinedReasonsMap } from '@shared/core-utils' import { AbuseFilter, AbuseObject, @@ -30,6 +30,7 @@ import { UserAbuse, UserVideoAbuse } from '@shared/models' +import { AttributesOnly } from '@shared/typescript-utils' import { ABUSE_STATES, CONSTRAINTS_FIELDS } from '../../initializers/constants' import { MAbuseAdminFormattable, MAbuseAP, MAbuseFull, MAbuseReporter, MAbuseUserFormattable, MUserAccountId } from '../../types/models' import { AccountModel, ScopeNames as AccountScopeNames, SummaryOptions as AccountSummaryOptions } from '../account/account' @@ -435,7 +436,7 @@ export class AbuseModel extends Model>> { buildBaseVideoCommentAbuse (this: MAbuseUserFormattable) { // Associated video comment could have been destroyed if the video has been deleted - if (!this.VideoCommentAbuse || !this.VideoCommentAbuse.VideoComment) return null + if (!this.VideoCommentAbuse?.VideoComment) return null const entity = this.VideoCommentAbuse.VideoComment @@ -562,6 +563,7 @@ export class AbuseModel extends Model>> { return { type: 'Flag' as 'Flag', content: this.reason, + mediaType: 'text/markdown', object, tag: predefinedReasons.map(r => ({ type: 'Hashtag' as 'Hashtag',