From 3487330d308166afb542cbacae0475693c0b059e Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 9 Jun 2020 16:07:10 +0200 Subject: preserve original variable names server-side --- server/models/account/user.ts | 4 ++-- server/models/video/video-blacklist.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'server/models') diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 4ea175583..fbd3080c6 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts @@ -739,11 +739,11 @@ export class UserModel extends Model { const videoUserId = video.VideoChannel.Account.userId if (video.isBlacklisted()) { - return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) + return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) } if (video.privacy === VideoPrivacy.PRIVATE) { - return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) + return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) } if (video.privacy === VideoPrivacy.INTERNAL) return true diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 70a6ecb03..8cbfe362e 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts @@ -3,7 +3,7 @@ import { getBlacklistSort, SortType, throwIfNotValid, searchAttribute } from '.. import { VideoModel } from './video' import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel' import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist' -import { VideoBlocklist, VideoBlockType } from '../../../shared/models/videos' +import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos' import { CONSTRAINTS_FIELDS } from '../../initializers/constants' import { FindOptions } from 'sequelize' import { ThumbnailModel } from './thumbnail' @@ -34,7 +34,7 @@ export class VideoBlacklistModel extends Model { @Default(null) @Is('VideoBlacklistType', value => throwIfNotValid(value, isVideoBlacklistTypeValid, 'type')) @Column - type: VideoBlockType + type: VideoBlacklistType @CreatedAt createdAt: Date @@ -59,7 +59,7 @@ export class VideoBlacklistModel extends Model { count: number sort: SortType search?: string - type?: VideoBlockType + type?: VideoBlacklistType }) { const { start, count, sort, search, type } = parameters @@ -119,7 +119,7 @@ export class VideoBlacklistModel extends Model { return VideoBlacklistModel.findOne(query) } - toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlocklist { + toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlacklist { return { id: this.id, createdAt: this.createdAt, -- cgit v1.2.3