mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(core): Use stricter typing on queries in cli commands (no-changelog) (#5476)
This has been broken since TypeORM upgrade Fixes: https://linear.app/n8n/issue/ENG-50 https://community.n8n.io/t/execute-command-stdout/22994
This commit is contained in:
committed by
GitHub
parent
522ddfc0cd
commit
a6c59fcbc2
@@ -1,6 +1,7 @@
|
||||
import { flags } from '@oclif/command';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { FindOptionsWhere } from 'typeorm';
|
||||
import * as Db from '@/Db';
|
||||
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
|
||||
import { BaseCommand } from '../BaseCommand';
|
||||
|
||||
export class ListWorkflowCommand extends BaseCommand {
|
||||
@@ -30,12 +31,12 @@ export class ListWorkflowCommand extends BaseCommand {
|
||||
this.error('The --active flag has to be passed using true or false');
|
||||
}
|
||||
|
||||
const findQuery: IDataObject = {};
|
||||
const findQuery: FindOptionsWhere<WorkflowEntity> = {};
|
||||
if (flags.active !== undefined) {
|
||||
findQuery.active = flags.active === 'true';
|
||||
}
|
||||
|
||||
const workflows = await Db.collections.Workflow.find(findQuery);
|
||||
const workflows = await Db.collections.Workflow.findBy(findQuery);
|
||||
if (flags.onlyId) {
|
||||
workflows.forEach((workflow) => this.logger.info(workflow.id));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user