aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/users.ts')
-rw-r--r--server/helpers/custom-validators/users.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts
index b59b766de..ce1323e94 100644
--- a/server/helpers/custom-validators/users.ts
+++ b/server/helpers/custom-validators/users.ts
@@ -2,7 +2,6 @@ import 'express-validator'
2import * as validator from 'validator' 2import * as validator from 'validator'
3import { UserRole } from '../../../shared' 3import { UserRole } from '../../../shared'
4import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers' 4import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers'
5
6import { exists, isFileValid } from './misc' 5import { exists, isFileValid } from './misc'
7import { values } from 'lodash' 6import { values } from 'lodash'
8 7
@@ -52,7 +51,7 @@ const avatarMimeTypes = CONSTRAINTS_FIELDS.ACTORS.AVATAR.EXTNAME
52 .join('|') 51 .join('|')
53const avatarMimeTypesRegex = `image/(${avatarMimeTypes})` 52const avatarMimeTypesRegex = `image/(${avatarMimeTypes})`
54function isAvatarFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { 53function isAvatarFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) {
55 return isFileValid(files, avatarMimeTypesRegex, 'avatarfile') 54 return isFileValid(files, avatarMimeTypesRegex, 'avatarfile', CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max)
56} 55}
57 56
58// --------------------------------------------------------------------------- 57// ---------------------------------------------------------------------------