+ const user = res.locals.oauth.token.User
+ if (!await doesUnblockServerExist(user.Account.id, req.params.host, res)) return
+
+ return next()
+ }
+]
+
+const unblockServerByServerValidator = [
+ param('host').custom(isHostValid).withMessage('Should have an account name with host'),
+
+ async (req: express.Request, res: express.Response, next: express.NextFunction) => {
+ logger.debug('Checking unblockServerByServerValidator parameters', { parameters: req.params })
+
+ if (areValidationErrors(req, res)) return
+
+ const serverActor = await getServerActor()
+ if (!await doesUnblockServerExist(serverActor.Account.id, req.params.host, res)) return
+
+ return next()
+ }
+]
+
+const blocklistStatusValidator = [
+ query('hosts')
+ .optional()
+ .customSanitizer(toArray)
+ .custom(isEachUniqueHostValid).withMessage('Should have a valid hosts array'),
+
+ query('accounts')
+ .optional()
+ .customSanitizer(toArray)
+ .custom(areValidActorHandles).withMessage('Should have a valid accounts array'),
+
+ (req: express.Request, res: express.Response, next: express.NextFunction) => {
+ logger.debug('Checking blocklistStatusValidator parameters', { query: req.query })
+
+ if (areValidationErrors(req, res)) return