diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-23 10:40:39 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 3e753302d8c911b59971c16a8018df0e1ab78465 (patch) | |
tree | efce7ece3273589228c5c948ea6757b2bdf65429 /server/middlewares/validators/videos/video-playlists.ts | |
parent | a8b666e9f1ed002230869606308749614390c82f (diff) | |
download | PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.gz PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.zst PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.zip |
Refactor middleware helpers
Diffstat (limited to 'server/middlewares/validators/videos/video-playlists.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-playlists.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts index 9c88dd291..638122a2e 100644 --- a/server/middlewares/validators/videos/video-playlists.ts +++ b/server/middlewares/validators/videos/video-playlists.ts | |||
@@ -4,11 +4,10 @@ import { UserRight, VideoPlaylistCreate, VideoPlaylistUpdate } from '../../../.. | |||
4 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
5 | import { UserModel } from '../../../models/account/user' | 5 | import { UserModel } from '../../../models/account/user' |
6 | import { areValidationErrors } from '../utils' | 6 | import { areValidationErrors } from '../utils' |
7 | import { doesVideoExist, isVideoImage } from '../../../helpers/custom-validators/videos' | 7 | import { isVideoImage } from '../../../helpers/custom-validators/videos' |
8 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' | 8 | import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' |
9 | import { isArrayOf, isIdOrUUIDValid, isIdValid, isUUIDValid, toIntArray, toValueOrNull } from '../../../helpers/custom-validators/misc' | 9 | import { isArrayOf, isIdOrUUIDValid, isIdValid, isUUIDValid, toIntArray, toValueOrNull } from '../../../helpers/custom-validators/misc' |
10 | import { | 10 | import { |
11 | doesVideoPlaylistExist, | ||
12 | isVideoPlaylistDescriptionValid, | 11 | isVideoPlaylistDescriptionValid, |
13 | isVideoPlaylistNameValid, | 12 | isVideoPlaylistNameValid, |
14 | isVideoPlaylistPrivacyValid, | 13 | isVideoPlaylistPrivacyValid, |
@@ -17,11 +16,11 @@ import { | |||
17 | } from '../../../helpers/custom-validators/video-playlists' | 16 | } from '../../../helpers/custom-validators/video-playlists' |
18 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | 17 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' |
19 | import { cleanUpReqFiles } from '../../../helpers/express-utils' | 18 | import { cleanUpReqFiles } from '../../../helpers/express-utils' |
20 | import { doesVideoChannelIdExist } from '../../../helpers/custom-validators/video-channels' | ||
21 | import { VideoPlaylistElementModel } from '../../../models/video/video-playlist-element' | 19 | import { VideoPlaylistElementModel } from '../../../models/video/video-playlist-element' |
22 | import { authenticatePromiseIfNeeded } from '../../oauth' | 20 | import { authenticatePromiseIfNeeded } from '../../oauth' |
23 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' | 21 | import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' |
24 | import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model' | 22 | import { VideoPlaylistType } from '../../../../shared/models/videos/playlist/video-playlist-type.model' |
23 | import { doesVideoChannelIdExist, doesVideoExist, doesVideoPlaylistExist } from '../../../helpers/middlewares' | ||
25 | 24 | ||
26 | const videoPlaylistsAddValidator = getCommonPlaylistEditAttributes().concat([ | 25 | const videoPlaylistsAddValidator = getCommonPlaylistEditAttributes().concat([ |
27 | body('displayName') | 26 | body('displayName') |