mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(server): auth service (#1383)
* refactor: auth * chore: tests * Remove await on non-async method * refactor: constants * chore: remove extra async Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export * from './dto';
|
||||
export * from './response-dto';
|
||||
export * from './system-config.constants';
|
||||
export * from './system-config.repository';
|
||||
export * from './system-config.service';
|
||||
export * from './system-config.datetime-variables';
|
||||
|
||||
@@ -18,3 +18,5 @@ export const supportedPresetTokens = [
|
||||
'{{y}}-{{MMM}}-{{dd}}/{{filename}}',
|
||||
'{{y}}-{{MMMM}}-{{dd}}/{{filename}}',
|
||||
];
|
||||
|
||||
export const INITIAL_SYSTEM_CONFIG = 'INITIAL_SYSTEM_CONFIG';
|
||||
@@ -37,12 +37,14 @@ const defaults: SystemConfig = Object.freeze({
|
||||
},
|
||||
});
|
||||
|
||||
const singleton = new Subject<SystemConfig>();
|
||||
|
||||
@Injectable()
|
||||
export class SystemConfigCore {
|
||||
private logger = new Logger(SystemConfigCore.name);
|
||||
private validators: SystemConfigValidator[] = [];
|
||||
|
||||
public config$ = new Subject<SystemConfig>();
|
||||
public config$ = singleton;
|
||||
|
||||
constructor(private repository: ISystemConfigRepository) {}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SystemConfigEntity, SystemConfigKey } from '@app/infra';
|
||||
import { SystemConfigEntity, SystemConfigKey } from '@app/infra/db/entities';
|
||||
import { BadRequestException } from '@nestjs/common';
|
||||
import { newJobRepositoryMock, newSystemConfigRepositoryMock, systemConfigStub } from '../../test';
|
||||
import { IJobRepository, JobName } from '../job';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
supportedPresetTokens,
|
||||
supportedSecondTokens,
|
||||
supportedYearTokens,
|
||||
} from './system-config.datetime-variables';
|
||||
} from './system-config.constants';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { IJobRepository, JobName } from '../job';
|
||||
import { mapConfig, SystemConfigDto } from './dto/system-config.dto';
|
||||
|
||||
Reference in New Issue
Block a user