diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-17 10:27:00 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-17 10:27:00 +0100 |
commit | 4c1c17093461b58d3ee3f23f239e340d8dac1149 (patch) | |
tree | 236b724f1415a812a4274fd63b519124cba2e42f /server/controllers/api | |
parent | 45f1bd72a08998c60a9dd68ff069cea9de39161c (diff) | |
download | PeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.tar.gz PeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.tar.zst PeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.zip |
Refactor email enabled function
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/config.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index a383a723f..06fe30371 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -11,10 +11,9 @@ import { ClientHtml } from '../../lib/client-html' | |||
11 | import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger' | 11 | import { auditLoggerFactory, CustomConfigAuditView, getAuditIdFromRes } from '../../helpers/audit-logger' |
12 | import { remove, writeJSON } from 'fs-extra' | 12 | import { remove, writeJSON } from 'fs-extra' |
13 | import { getServerCommit } from '../../helpers/utils' | 13 | import { getServerCommit } from '../../helpers/utils' |
14 | import { Emailer } from '../../lib/emailer' | ||
15 | import validator from 'validator' | 14 | import validator from 'validator' |
16 | import { objectConverter } from '../../helpers/core-utils' | 15 | import { objectConverter } from '../../helpers/core-utils' |
17 | import { CONFIG, reloadConfig } from '../../initializers/config' | 16 | import { CONFIG, isEmailEnabled, reloadConfig } from '../../initializers/config' |
18 | import { PluginManager } from '../../lib/plugins/plugin-manager' | 17 | import { PluginManager } from '../../lib/plugins/plugin-manager' |
19 | import { getThemeOrDefault } from '../../lib/plugins/theme-utils' | 18 | import { getThemeOrDefault } from '../../lib/plugins/theme-utils' |
20 | import { Hooks } from '@server/lib/plugins/hooks' | 19 | import { Hooks } from '@server/lib/plugins/hooks' |
@@ -87,7 +86,7 @@ async function getConfig (req: express.Request, res: express.Response) { | |||
87 | default: defaultTheme | 86 | default: defaultTheme |
88 | }, | 87 | }, |
89 | email: { | 88 | email: { |
90 | enabled: Emailer.isEnabled() | 89 | enabled: isEmailEnabled() |
91 | }, | 90 | }, |
92 | contactForm: { | 91 | contactForm: { |
93 | enabled: CONFIG.CONTACT_FORM.ENABLED | 92 | enabled: CONFIG.CONTACT_FORM.ENABLED |