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:
Csaba Tuncsik
2023-02-16 10:36:24 +01:00
committed by GitHub
parent 1a20fd9f46
commit a2c6ea9e11
5 changed files with 51 additions and 117 deletions

View File

@@ -151,7 +151,7 @@ describe('PUT /workflows/:id', () => {
});
describe('GET /workflows', () => {
test('should return workflows with ownership, sharing and credential usage details', async () => {
test('should return workflows without nodes, sharing and credential usage details', async () => {
const owner = await testDb.createUser({ globalRole: globalOwnerRole });
const member = await testDb.createUser({ globalRole: globalMemberRole });
@@ -188,32 +188,11 @@ describe('GET /workflows', () => {
expect(response.statusCode).toBe(200);
expect(fetchedWorkflow.ownedBy).toMatchObject({
id: owner.id,
email: owner.email,
firstName: owner.firstName,
lastName: owner.lastName,
});
expect(fetchedWorkflow.sharedWith).toHaveLength(1);
const [sharee] = fetchedWorkflow.sharedWith;
expect(sharee).toMatchObject({
id: member.id,
email: member.email,
firstName: member.firstName,
lastName: member.lastName,
});
expect(fetchedWorkflow.usedCredentials).toHaveLength(1);
const [usedCredential] = fetchedWorkflow.usedCredentials;
expect(usedCredential).toMatchObject({
id: savedCredential.id,
name: savedCredential.name,
type: savedCredential.type,
currentUserHasAccess: true,
});
expect(fetchedWorkflow.sharedWith).not.toBeDefined()
expect(fetchedWorkflow.usedCredentials).not.toBeDefined()
expect(fetchedWorkflow.nodes).not.toBeDefined()
});
});