fix(core): Remove unnecessary info from GET /workflows response (#5311)
* fix(core): Remove unnecessary info from `GET /workflows` response * fix(core): Remove unnecessary info from `GET /workflows` response * fix(core): Remove credentials from `GET /workflows` response * fix(core): Update unit tests for `GET /workflows` response * fix(core): Remove `usedCredentials` from `GET /workflows` response * fix(core): Update unit tests for `GET /workflows` response * fix(core): remove nodes from getMany * fix(core): remove unnecessary owner props from workflow list items * fix(core): fix lint error * fix(core): remove unused function * fix(core): simplifying ownerId usage * fix(core): trim down the query for workflow listing
This commit is contained in:
@@ -203,12 +203,16 @@ EEWorkflowController.post(
|
||||
EEWorkflowController.get(
|
||||
'/',
|
||||
ResponseHelper.send(async (req: WorkflowRequest.GetAll) => {
|
||||
const workflows = await EEWorkflows.getMany(req.user, req.query.filter);
|
||||
await EEWorkflows.addCredentialsToWorkflows(workflows, req.user);
|
||||
const [workflows, workflowOwnerRole] = await Promise.all([
|
||||
EEWorkflows.getMany(req.user, req.query.filter),
|
||||
Db.collections.Role.findOneOrFail({
|
||||
select: ['id'],
|
||||
where: { name: 'owner', scope: 'workflow' },
|
||||
}),
|
||||
]);
|
||||
|
||||
return workflows.map((workflow) => {
|
||||
EEWorkflows.addOwnerAndSharings(workflow);
|
||||
workflow.nodes = [];
|
||||
EEWorkflows.addOwnerId(workflow, workflowOwnerRole);
|
||||
return workflow;
|
||||
});
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user