aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/feeds.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/feeds.ts')
-rw-r--r--server/middlewares/validators/feeds.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/middlewares/validators/feeds.ts b/server/middlewares/validators/feeds.ts
index 969ce2526..e4f5c98fe 100644
--- a/server/middlewares/validators/feeds.ts
+++ b/server/middlewares/validators/feeds.ts
@@ -1,12 +1,12 @@
1import * as express from 'express' 1import * as express from 'express'
2import { param, query } from 'express-validator/check' 2import { param, query } from 'express-validator/check'
3import { isAccountIdExist, isAccountNameValid, isAccountNameWithHostExist } from '../../helpers/custom-validators/accounts' 3import { doesAccountIdExist, isAccountNameValid, doesAccountNameWithHostExist } from '../../helpers/custom-validators/accounts'
4import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' 4import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
5import { logger } from '../../helpers/logger' 5import { logger } from '../../helpers/logger'
6import { areValidationErrors } from './utils' 6import { areValidationErrors } from './utils'
7import { isValidRSSFeed } from '../../helpers/custom-validators/feeds' 7import { isValidRSSFeed } from '../../helpers/custom-validators/feeds'
8import { isVideoChannelIdExist, isVideoChannelNameWithHostExist } from '../../helpers/custom-validators/video-channels' 8import { doesVideoChannelIdExist, doesVideoChannelNameWithHostExist } from '../../helpers/custom-validators/video-channels'
9import { isVideoExist } from '../../helpers/custom-validators/videos' 9import { doesVideoExist } from '../../helpers/custom-validators/videos'
10import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor' 10import { isActorPreferredUsernameValid } from '../../helpers/custom-validators/activitypub/actor'
11 11
12const videoFeedsValidator = [ 12const videoFeedsValidator = [
@@ -22,10 +22,10 @@ const videoFeedsValidator = [
22 22
23 if (areValidationErrors(req, res)) return 23 if (areValidationErrors(req, res)) return
24 24
25 if (req.query.accountId && !await isAccountIdExist(req.query.accountId, res)) return 25 if (req.query.accountId && !await doesAccountIdExist(req.query.accountId, res)) return
26 if (req.query.videoChannelId && !await isVideoChannelIdExist(req.query.videoChannelId, res)) return 26 if (req.query.videoChannelId && !await doesVideoChannelIdExist(req.query.videoChannelId, res)) return
27 if (req.query.accountName && !await isAccountNameWithHostExist(req.query.accountName, res)) return 27 if (req.query.accountName && !await doesAccountNameWithHostExist(req.query.accountName, res)) return
28 if (req.query.videoChannelName && !await isVideoChannelNameWithHostExist(req.query.videoChannelName, res)) return 28 if (req.query.videoChannelName && !await doesVideoChannelNameWithHostExist(req.query.videoChannelName, res)) return
29 29
30 return next() 30 return next()
31 } 31 }
@@ -41,7 +41,7 @@ const videoCommentsFeedsValidator = [
41 41
42 if (areValidationErrors(req, res)) return 42 if (areValidationErrors(req, res)) return
43 43
44 if (req.query.videoId && !await isVideoExist(req.query.videoId, res)) return 44 if (req.query.videoId && !await doesVideoExist(req.query.videoId, res)) return
45 45
46 return next() 46 return next()
47 } 47 }