diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-14 15:28:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-14 15:28:30 +0200 |
commit | 06215f15e0a9fea2ef95b8b49cb2b5868fb64017 (patch) | |
tree | 6f7ff9f82ea851ea87fd3fc4b61843c7a38aec43 /server/middlewares | |
parent | 59c76ffa8f503e962d517c78f033f1beccb1de1a (diff) | |
download | PeerTube-06215f15e0a9fea2ef95b8b49cb2b5868fb64017.tar.gz PeerTube-06215f15e0a9fea2ef95b8b49cb2b5868fb64017.tar.zst PeerTube-06215f15e0a9fea2ef95b8b49cb2b5868fb64017.zip |
Cleanup utils helper
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/cache.ts | 2 | ||||
-rw-r--r-- | server/middlewares/sort.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/avatar.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/users.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/video-captions.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/video-imports.ts | 2 | ||||
-rw-r--r-- | server/middlewares/validators/videos.ts | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/server/middlewares/cache.ts b/server/middlewares/cache.ts index c671b88c9..b40486e4b 100644 --- a/server/middlewares/cache.ts +++ b/server/middlewares/cache.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as AsyncLock from 'async-lock' | 2 | import * as AsyncLock from 'async-lock' |
3 | import { parseDuration } from '../helpers/utils' | 3 | import { parseDuration } from '../helpers/core-utils' |
4 | import { Redis } from '../lib/redis' | 4 | import { Redis } from '../lib/redis' |
5 | import { logger } from '../helpers/logger' | 5 | import { logger } from '../helpers/logger' |
6 | 6 | ||
diff --git a/server/middlewares/sort.ts b/server/middlewares/sort.ts index 5120804b3..6507aa5b8 100644 --- a/server/middlewares/sort.ts +++ b/server/middlewares/sort.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import 'express-validator' | 2 | import 'express-validator' |
3 | import { SortType } from '../helpers/utils' | 3 | import { SortType } from '../models/utils' |
4 | 4 | ||
5 | function setDefaultSort (req: express.Request, res: express.Response, next: express.NextFunction) { | 5 | function setDefaultSort (req: express.Request, res: express.Response, next: express.NextFunction) { |
6 | if (!req.query.sort) req.query.sort = '-createdAt' | 6 | if (!req.query.sort) req.query.sort = '-createdAt' |
diff --git a/server/middlewares/validators/avatar.ts b/server/middlewares/validators/avatar.ts index 5860735c6..ddc14f531 100644 --- a/server/middlewares/validators/avatar.ts +++ b/server/middlewares/validators/avatar.ts | |||
@@ -4,7 +4,7 @@ import { isAvatarFile } from '../../helpers/custom-validators/users' | |||
4 | import { areValidationErrors } from './utils' | 4 | import { areValidationErrors } from './utils' |
5 | import { CONSTRAINTS_FIELDS } from '../../initializers' | 5 | import { CONSTRAINTS_FIELDS } from '../../initializers' |
6 | import { logger } from '../../helpers/logger' | 6 | import { logger } from '../../helpers/logger' |
7 | import { cleanUpReqFiles } from '../../helpers/utils' | 7 | import { cleanUpReqFiles } from '../../helpers/express-utils' |
8 | 8 | ||
9 | const updateAvatarValidator = [ | 9 | const updateAvatarValidator = [ |
10 | body('avatarfile').custom((value, { req }) => isAvatarFile(req.files)).withMessage( | 10 | body('avatarfile').custom((value, { req }) => isAvatarFile(req.files)).withMessage( |
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 771c414a0..f47fa8b48 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -16,7 +16,7 @@ import { | |||
16 | } from '../../helpers/custom-validators/users' | 16 | } from '../../helpers/custom-validators/users' |
17 | import { isVideoExist } from '../../helpers/custom-validators/videos' | 17 | import { isVideoExist } from '../../helpers/custom-validators/videos' |
18 | import { logger } from '../../helpers/logger' | 18 | import { logger } from '../../helpers/logger' |
19 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/utils' | 19 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' |
20 | import { Redis } from '../../lib/redis' | 20 | import { Redis } from '../../lib/redis' |
21 | import { UserModel } from '../../models/account/user' | 21 | import { UserModel } from '../../models/account/user' |
22 | import { areValidationErrors } from './utils' | 22 | import { areValidationErrors } from './utils' |
diff --git a/server/middlewares/validators/video-captions.ts b/server/middlewares/validators/video-captions.ts index 18d537bc4..4f393ea84 100644 --- a/server/middlewares/validators/video-captions.ts +++ b/server/middlewares/validators/video-captions.ts | |||
@@ -7,7 +7,7 @@ import { CONSTRAINTS_FIELDS } from '../../initializers' | |||
7 | import { UserRight } from '../../../shared' | 7 | import { UserRight } from '../../../shared' |
8 | import { logger } from '../../helpers/logger' | 8 | import { logger } from '../../helpers/logger' |
9 | import { isVideoCaptionExist, isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' | 9 | import { isVideoCaptionExist, isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../helpers/custom-validators/video-captions' |
10 | import { cleanUpReqFiles } from '../../helpers/utils' | 10 | import { cleanUpReqFiles } from '../../helpers/express-utils' |
11 | 11 | ||
12 | const addVideoCaptionValidator = [ | 12 | const addVideoCaptionValidator = [ |
13 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid video id'), | 13 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid video id'), |
diff --git a/server/middlewares/validators/video-imports.ts b/server/middlewares/validators/video-imports.ts index 9ac739101..b2063b8da 100644 --- a/server/middlewares/validators/video-imports.ts +++ b/server/middlewares/validators/video-imports.ts | |||
@@ -5,7 +5,7 @@ import { logger } from '../../helpers/logger' | |||
5 | import { areValidationErrors } from './utils' | 5 | import { areValidationErrors } from './utils' |
6 | import { getCommonVideoAttributes } from './videos' | 6 | import { getCommonVideoAttributes } from './videos' |
7 | import { isVideoImportTargetUrlValid, isVideoImportTorrentFile } from '../../helpers/custom-validators/video-imports' | 7 | import { isVideoImportTargetUrlValid, isVideoImportTorrentFile } from '../../helpers/custom-validators/video-imports' |
8 | import { cleanUpReqFiles } from '../../helpers/utils' | 8 | import { cleanUpReqFiles } from '../../helpers/express-utils' |
9 | import { isVideoChannelOfAccountExist, isVideoMagnetUriValid, isVideoNameValid } from '../../helpers/custom-validators/videos' | 9 | import { isVideoChannelOfAccountExist, isVideoMagnetUriValid, isVideoNameValid } from '../../helpers/custom-validators/videos' |
10 | import { CONFIG } from '../../initializers/constants' | 10 | import { CONFIG } from '../../initializers/constants' |
11 | import { CONSTRAINTS_FIELDS } from '../../initializers' | 11 | import { CONSTRAINTS_FIELDS } from '../../initializers' |
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts index 77d601a4d..53c32abb8 100644 --- a/server/middlewares/validators/videos.ts +++ b/server/middlewares/validators/videos.ts | |||
@@ -34,7 +34,7 @@ import { CONSTRAINTS_FIELDS } from '../../initializers' | |||
34 | import { VideoShareModel } from '../../models/video/video-share' | 34 | import { VideoShareModel } from '../../models/video/video-share' |
35 | import { authenticate } from '../oauth' | 35 | import { authenticate } from '../oauth' |
36 | import { areValidationErrors } from './utils' | 36 | import { areValidationErrors } from './utils' |
37 | import { cleanUpReqFiles } from '../../helpers/utils' | 37 | import { cleanUpReqFiles } from '../../helpers/express-utils' |
38 | import { VideoModel } from '../../models/video/video' | 38 | import { VideoModel } from '../../models/video/video' |
39 | import { UserModel } from '../../models/account/user' | 39 | import { UserModel } from '../../models/account/user' |
40 | 40 | ||