aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-28 17:30:59 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-06-29 14:56:35 +0200
commitd4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb (patch)
treea4cb07318100031951c3dffc61f4f2cb95d2cbd0 /server/middlewares/validators/users.ts
parent62ddc31a9e4b92d7d27898ccfc363f68ab044139 (diff)
downloadPeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.gz
PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.zst
PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.zip
Support short uuid for GET video/playlist
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r--server/middlewares/validators/users.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index 218633b8d..698d7d814 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -7,7 +7,7 @@ import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-code
7import { UserRole } from '../../../shared/models/users' 7import { UserRole } from '../../../shared/models/users'
8import { UserRegister } from '../../../shared/models/users/user-register.model' 8import { UserRegister } from '../../../shared/models/users/user-register.model'
9import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor' 9import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor'
10import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc' 10import { toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
11import { isThemeNameValid } from '../../helpers/custom-validators/plugins' 11import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
12import { 12import {
13 isNoInstanceConfigWarningModal, 13 isNoInstanceConfigWarningModal,
@@ -35,7 +35,7 @@ import { Redis } from '../../lib/redis'
35import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../lib/signup' 35import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../lib/signup'
36import { ActorModel } from '../../models/actor/actor' 36import { ActorModel } from '../../models/actor/actor'
37import { UserModel } from '../../models/user/user' 37import { UserModel } from '../../models/user/user'
38import { areValidationErrors, doesVideoExist } from './shared' 38import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from './shared'
39 39
40const usersListValidator = [ 40const usersListValidator = [
41 query('blocked') 41 query('blocked')
@@ -302,7 +302,7 @@ const usersGetValidator = [
302] 302]
303 303
304const usersVideoRatingValidator = [ 304const usersVideoRatingValidator = [
305 param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid video id'), 305 isValidVideoIdParam('videoId'),
306 306
307 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 307 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
308 logger.debug('Checking usersVideoRating parameters', { parameters: req.params }) 308 logger.debug('Checking usersVideoRating parameters', { parameters: req.params })