fix(server): validation events actually throwing an error (#8172)

* fix validation events

* add e2e test
This commit is contained in:
Daniel Dietzler
2024-03-21 23:59:21 +01:00
committed by GitHub
parent 508f32c08a
commit d6823b128c
5 changed files with 36 additions and 8 deletions

View File

@@ -1,5 +1,4 @@
import { Inject, Injectable } from '@nestjs/common';
import { OnEvent } from '@nestjs/event-emitter';
import handlebar from 'handlebars';
import { DateTime } from 'luxon';
import path from 'node:path';
@@ -15,6 +14,7 @@ import {
} from 'src/constants';
import { StorageCore, StorageFolder } from 'src/cores/storage.core';
import { SystemConfigCore } from 'src/cores/system-config.core';
import { OnEventInternal } from 'src/decorators';
import { AssetEntity, AssetType } from 'src/entities/asset.entity';
import { AssetPathType } from 'src/entities/move.entity';
import { SystemConfig } from 'src/entities/system-config.entity';
@@ -86,7 +86,7 @@ export class StorageTemplateService {
);
}
@OnEvent(InternalEvent.VALIDATE_CONFIG)
@OnEventInternal(InternalEvent.VALIDATE_CONFIG)
validate({ newConfig }: InternalEventMap[InternalEvent.VALIDATE_CONFIG]) {
try {
const { compiled } = this.compile(newConfig.storageTemplate.template);