import { UserRole } from '../../../shared/models/users'
import { UserRegister } from '../../../shared/models/users/user-register.model'
import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor'
-import { isIdOrUUIDValid, toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
+import { toBooleanOrNull, toIntOrNull } from '../../helpers/custom-validators/misc'
import { isThemeNameValid } from '../../helpers/custom-validators/plugins'
import {
isNoInstanceConfigWarningModal,
} from '../../helpers/custom-validators/users'
import { isVideoChannelNameValid } from '../../helpers/custom-validators/video-channels'
import { logger } from '../../helpers/logger'
-import { doesVideoExist } from '../../helpers/middlewares'
-import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup'
import { isThemeRegistered } from '../../lib/plugins/theme-utils'
import { Redis } from '../../lib/redis'
-import { UserModel } from '../../models/user/user'
+import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../lib/signup'
import { ActorModel } from '../../models/actor/actor'
-import { areValidationErrors } from './utils'
+import { UserModel } from '../../models/user/user'
+import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from './shared'
const usersListValidator = [
query('blocked')
]
const usersVideoRatingValidator = [
- param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid video id'),
+ isValidVideoIdParam('videoId'),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking usersVideoRating parameters', { parameters: req.params })