mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(server): skip smtp validation if unchanged (#12111)
* fix(server): skip smtp validation if unchanged * update comparison + convert config to plain object
This commit is contained in:
parent
d08a20bd57
commit
74f18a4523
4 changed files with 29 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ import { SystemConfigDto, SystemConfigTemplateStorageOptionDto, mapConfig } from
|
|||
import { ArgOf, ClientEvent, IEventRepository, ServerEvent } from 'src/interfaces/event.interface';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { ISystemMetadataRepository } from 'src/interfaces/system-metadata.interface';
|
||||
import { toPlainObject } from 'src/utils/object';
|
||||
|
||||
@Injectable()
|
||||
export class SystemConfigService {
|
||||
|
|
@ -63,7 +64,7 @@ export class SystemConfigService {
|
|||
const oldConfig = await this.core.getConfig({ withCache: false });
|
||||
|
||||
try {
|
||||
await this.eventRepository.emit('config.validate', { newConfig: dto, oldConfig });
|
||||
await this.eventRepository.emit('config.validate', { newConfig: toPlainObject(dto), oldConfig });
|
||||
} catch (error) {
|
||||
this.logger.warn(`Unable to save system config due to a validation error: ${error}`);
|
||||
throw new BadRequestException(error instanceof Error ? error.message : error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue