fix(core): Return homeProject when filtering workflows by project id (#12077)

This commit is contained in:
Danny Martini
2024-12-08 19:45:41 +01:00
committed by GitHub
parent 596f22103c
commit efafeed334
4 changed files with 48 additions and 5 deletions
@@ -211,4 +211,13 @@ export class SharedWorkflowRepository extends Repository<SharedWorkflow> {
},
});
}
async getAllRelationsForWorkflows(workflowIds: string[]) {
return await this.find({
where: {
workflowId: In(workflowIds),
},
relations: ['project'],
});
}
}
@@ -95,7 +95,8 @@ export class WorkflowRepository extends Repository<WorkflowEntity> {
.execute();
}
async getMany(sharedWorkflowIds: string[], options?: ListQuery.Options) {
async getMany(sharedWorkflowIds: string[], originalOptions: ListQuery.Options = {}) {
const options = structuredClone(originalOptions);
if (sharedWorkflowIds.length === 0) return { workflows: [], count: 0 };
if (typeof options?.filter?.projectId === 'string' && options.filter.projectId !== '') {