From 4c1c17093461b58d3ee3f23f239e340d8dac1149 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Feb 2020 10:27:00 +0100 Subject: Refactor email enabled function --- server/middlewares/validators/server.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/middlewares/validators/server.ts') diff --git a/server/middlewares/validators/server.ts b/server/middlewares/validators/server.ts index f6812647b..6158c3363 100644 --- a/server/middlewares/validators/server.ts +++ b/server/middlewares/validators/server.ts @@ -5,9 +5,8 @@ import { isHostValid, isValidContactBody } from '../../helpers/custom-validators import { ServerModel } from '../../models/server/server' import { body } from 'express-validator' import { isUserDisplayNameValid } from '../../helpers/custom-validators/users' -import { Emailer } from '../../lib/emailer' import { Redis } from '../../lib/redis' -import { CONFIG } from '../../initializers/config' +import { CONFIG, isEmailEnabled } from '../../initializers/config' const serverGetValidator = [ body('host').custom(isHostValid).withMessage('Should have a valid host'), @@ -50,7 +49,7 @@ const contactAdministratorValidator = [ .end() } - if (Emailer.isEnabled() === false) { + if (isEmailEnabled() === false) { return res .status(409) .send({ error: 'Emailer is not enabled on this instance.' }) -- cgit v1.2.3