refactor(core): Move more typeorm operators to repositories (no-changelog) (#8143)
Follow-up to #8139
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Service } from 'typedi';
|
||||
import { DataSource, Repository } from 'typeorm';
|
||||
import { DataSource, In, Repository } from 'typeorm';
|
||||
import { ExecutionData } from '../entities/ExecutionData';
|
||||
|
||||
@Service()
|
||||
@@ -7,4 +7,13 @@ export class ExecutionDataRepository extends Repository<ExecutionData> {
|
||||
constructor(dataSource: DataSource) {
|
||||
super(ExecutionData, dataSource.manager);
|
||||
}
|
||||
|
||||
async findByExecutionIds(executionIds: string[]) {
|
||||
return this.find({
|
||||
select: ['workflowData'],
|
||||
where: {
|
||||
executionId: In(executionIds),
|
||||
},
|
||||
}).then((executionData) => executionData.map(({ workflowData }) => workflowData));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user