From bd45d503e5d007e730f4e81dccd7e7864c9a85cc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Aug 2020 14:58:01 +0200 Subject: Reorganize shared models --- server/controllers/api/abuse.ts | 7 ++++--- server/controllers/client.ts | 10 +++++----- server/controllers/plugins.ts | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/abuse.ts b/server/controllers/api/abuse.ts index 03e6be8c8..b97b99f16 100644 --- a/server/controllers/api/abuse.ts +++ b/server/controllers/api/abuse.ts @@ -1,9 +1,12 @@ import * as express from 'express' +import { logger } from '@server/helpers/logger' import { createAccountAbuse, createVideoAbuse, createVideoCommentAbuse } from '@server/lib/moderation' +import { Notifier } from '@server/lib/notifier' import { AbuseModel } from '@server/models/abuse/abuse' import { AbuseMessageModel } from '@server/models/abuse/abuse-message' import { getServerActor } from '@server/models/application/application' -import { AbuseCreate, abusePredefinedReasonsMap, AbuseState, UserRight } from '../../../shared' +import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' +import { AbuseCreate, AbuseState, UserRight } from '../../../shared' import { getFormattedObjects } from '../../helpers/utils' import { sequelizeTypescript } from '../../initializers/database' import { @@ -25,8 +28,6 @@ import { setDefaultSort } from '../../middlewares' import { AccountModel } from '../../models/account/account' -import { Notifier } from '@server/lib/notifier' -import { logger } from '@server/helpers/logger' const abuseRouter = express.Router() diff --git a/server/controllers/client.ts b/server/controllers/client.ts index 8c7f881a9..7c80820f4 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts @@ -1,13 +1,13 @@ -import { constants, promises as fs } from 'fs' import * as express from 'express' +import { constants, promises as fs } from 'fs' import { join } from 'path' +import { CONFIG } from '@server/initializers/config' +import { buildFileLocale, getCompleteLocale, is18nLocale, LOCALE_FILES } from '@shared/core-utils/i18n' import { root } from '../helpers/core-utils' +import { logger } from '../helpers/logger' import { ACCEPT_HEADERS, STATIC_MAX_AGE } from '../initializers/constants' -import { asyncMiddleware, embedCSP } from '../middlewares' -import { buildFileLocale, getCompleteLocale, is18nLocale, LOCALE_FILES } from '../../shared/models/i18n/i18n' import { ClientHtml } from '../lib/client-html' -import { logger } from '../helpers/logger' -import { CONFIG } from '@server/initializers/config' +import { asyncMiddleware, embedCSP } from '../middlewares' const clientsRouter = express.Router() diff --git a/server/controllers/plugins.ts b/server/controllers/plugins.ts index f88a1632d..7b947bb6e 100644 --- a/server/controllers/plugins.ts +++ b/server/controllers/plugins.ts @@ -6,7 +6,7 @@ import { getPluginValidator, pluginStaticDirectoryValidator, getExternalAuthVali import { serveThemeCSSValidator } from '../middlewares/validators/themes' import { PluginType } from '../../shared/models/plugins/plugin.type' import { isTestInstance } from '../helpers/core-utils' -import { getCompleteLocale, is18nLocale } from '../../shared/models/i18n' +import { getCompleteLocale, is18nLocale } from '../../shared/core-utils/i18n' import { logger } from '@server/helpers/logger' const sendFileOptions = { -- cgit v1.2.3