immich/server/libs/immich-config/src/immich-config.module.ts
Jason Rasmussen 131caa20eb
refactor(server): domain/infra (#1298)
* refactor: user repository

* refactor: user module

* refactor: move database into infra

* refactor(cli): use user core

* chore: import path

* chore: tests
2023-01-11 21:34:36 -05:00

25 lines
691 B
TypeScript

import { SystemConfigEntity } from '@app/infra';
import { Module, Provider } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ImmichConfigService } from './immich-config.service';
export const INITIAL_SYSTEM_CONFIG = 'INITIAL_SYSTEM_CONFIG';
const providers: Provider[] = [
ImmichConfigService,
{
provide: INITIAL_SYSTEM_CONFIG,
inject: [ImmichConfigService],
useFactory: async (configService: ImmichConfigService) => {
return configService.getConfig();
},
},
];
@Module({
imports: [TypeOrmModule.forFeature([SystemConfigEntity])],
providers: [...providers],
exports: [...providers],
})
export class ImmichConfigModule {}