refactor(core): Move active workflows endpoints to a decorated controller class (no-changelog) (#8101)

This is a continuation of migrating all rest endpoints to decorated controller classes
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-12-22 11:28:42 +01:00
committed by GitHub
parent 39e45d8b92
commit 021add0f39
12 changed files with 226 additions and 133 deletions

View File

@@ -23,6 +23,14 @@ export class WorkflowRepository extends Repository<WorkflowEntity> {
});
}
async getActiveIds() {
const activeWorkflows = await this.find({
select: ['id'],
where: { active: true },
});
return activeWorkflows.map((workflow) => workflow.id);
}
async findById(workflowId: string) {
return this.findOne({
where: { id: workflowId },