From 350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Nov 2017 17:31:26 +0100 Subject: Follow works --- server/initializers/checker.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'server/initializers/checker.ts') diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts index b69188f7e..317d59423 100644 --- a/server/initializers/checker.ts +++ b/server/initializers/checker.ts @@ -1,8 +1,8 @@ import * as config from 'config' - import { promisify0 } from '../helpers/core-utils' -import { OAuthClientModel } from '../models/oauth/oauth-client-interface' import { UserModel } from '../models/account/user-interface' +import { ApplicationModel } from '../models/application/application-interface' +import { OAuthClientModel } from '../models/oauth/oauth-client-interface' // Some checks on configuration files function checkConfig () { @@ -70,6 +70,13 @@ async function usersExist (User: UserModel) { return totalUsers !== 0 } +// We get db by param to not import it in this file (import orders) +async function applicationExist (Application: ApplicationModel) { + const totalApplication = await Application.countTotal() + + return totalApplication !== 0 +} + // --------------------------------------------------------------------------- export { @@ -77,5 +84,6 @@ export { checkFFmpeg, checkMissedConfig, clientsExist, - usersExist + usersExist, + applicationExist } -- cgit v1.2.3