Fix TypeScript errors in action engine

This commit is contained in:
Thaum Rystra
2025-05-02 15:38:18 +02:00
parent d42d2a724e
commit ae5a159e58
31 changed files with 198 additions and 93 deletions

View File

@@ -9,7 +9,12 @@ export default async function applyNoteProperty(
task: PropTask, action: EngineAction, result: TaskResult, inputProvider: InputProvider
): Promise<void> {
const prop = task.prop;
const logContent: LogContent & { silenced: boolean } = {
if (prop.type !== 'note') {
throw new Meteor.Error('wrong-property', `Expected a note, got ${prop.type} instead`);
}
const logContent: LogContent & { silenced: boolean | undefined; } = {
silenced: prop.silent,
};
if (prop.name) logContent.name = prop.name;