import { areValidationErrors } from './shared'
const userSubscriptionListValidator = [
- query('search').optional().not().isEmpty().withMessage('Should have a valid search'),
+ query('search')
+ .optional()
+ .not().isEmpty(),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking userSubscriptionListValidator parameters', { parameters: req.query })
]
const userSubscriptionAddValidator = [
- body('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'),
+ body('uri')
+ .custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking userSubscriptionAddValidator parameters', { parameters: req.body })
const areSubscriptionsExistValidator = [
query('uris')
.customSanitizer(toArray)
- .custom(areValidActorHandles).withMessage('Should have a valid uri array'),
+ .custom(areValidActorHandles).withMessage('Should have a valid array of URIs'),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking areSubscriptionsExistValidator parameters', { parameters: req.query })
]
const userSubscriptionGetValidator = [
- param('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to unfollow'),
+ param('uri')
+ .custom(isValidActorHandle),
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking userSubscriptionGetValidator parameters', { parameters: req.params })