X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fabuse%2Fabuse.ts;h=4ce40bf2f389736210d25f05306cb86e4447447e;hb=8c4bbd946d2247c2e239cbbf8773d2d31c1a57aa;hp=3518f5c02983b227554391b313d5845f480dc633;hpb=1c5e49e75284100b7b1fc8b4e73c8ba53fe22e89;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/abuse/abuse.ts b/server/models/abuse/abuse.ts index 3518f5c02..4ce40bf2f 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,16 +30,17 @@ 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' -import { getSort, throwIfNotValid } from '../utils' +import { getSort, throwIfNotValid } from '../shared' import { ThumbnailModel } from '../video/thumbnail' import { ScopeNames as VideoScopeNames, VideoModel } from '../video/video' import { VideoBlacklistModel } from '../video/video-blacklist' import { ScopeNames as VideoChannelScopeNames, SummaryOptions as ChannelSummaryOptions, VideoChannelModel } from '../video/video-channel' import { ScopeNames as CommentScopeNames, VideoCommentModel } from '../video/video-comment' -import { buildAbuseListQuery, BuildAbusesQueryOptions } from './abuse-query-builder' +import { buildAbuseListQuery, BuildAbusesQueryOptions } from './sql/abuse-query-builder' import { VideoAbuseModel } from './video-abuse' import { VideoCommentAbuseModel } from './video-comment-abuse' @@ -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',