Consolidate all service definitions in one module

This commit is contained in:
Alejandro Celaya
2025-11-15 10:33:42 +01:00
parent 373f0dbbbb
commit 4b655761c6
6 changed files with 50 additions and 79 deletions

View File

@@ -1,22 +0,0 @@
import type Bottle from 'bottlejs';
import { CreateServerFactory } from '../CreateServer';
import { ImportServersBtnFactory } from '../helpers/ImportServersBtn';
import { withoutSelectedServer } from '../helpers/withoutSelectedServer';
import { ManageServersFactory } from '../ManageServers';
import { ServersExporter } from './ServersExporter';
import { ServersImporter } from './ServersImporter';
export const provideServices = (bottle: Bottle) => {
// Components
bottle.factory('ManageServers', ManageServersFactory);
bottle.decorator('ManageServers', withoutSelectedServer);
bottle.factory('CreateServer', CreateServerFactory);
bottle.decorator('CreateServer', withoutSelectedServer);
bottle.factory('ImportServersBtn', ImportServersBtnFactory);
// Services
bottle.service('ServersImporter', ServersImporter, 'csvToJson');
bottle.service('ServersExporter', ServersExporter, 'Storage', 'window', 'jsonToCsv');
};