From e88333755167b3af23e0a4cea197bd822e24405d Mon Sep 17 00:00:00 2001 From: Meeran Tofiq <101665499+Meeran-Tofiq@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:09:20 +0300 Subject: [PATCH 1/2] fix(api): remove project IDs from exportData resp Signed-off-by: Meeran Tofiq <101665499+Meeran-Tofiq@users.noreply.github.com> --- apps/api/src/workspace/service/workspace.service.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/api/src/workspace/service/workspace.service.ts b/apps/api/src/workspace/service/workspace.service.ts index a13c2538..5fffa44a 100644 --- a/apps/api/src/workspace/service/workspace.service.ts +++ b/apps/api/src/workspace/service/workspace.service.ts @@ -277,12 +277,7 @@ export class WorkspaceService { description: true, colorCode: true, hasAdminAuthority: true, - authorities: true, - projects: { - select: { - id: true - } - } + authorities: true } }) From f0d71d2d39d5e4c8313d30664c3183907db066ef Mon Sep 17 00:00:00 2001 From: Meeran Tofiq <101665499+Meeran-Tofiq@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:12:31 +0300 Subject: [PATCH 2/2] Test(api): test workspaceRole fields when exported Mdified an existing test to now check for the fiel -ds of the workspaceRole, when using the exportDat -a api endpoint on a workspace. Signed-off-by: Meeran Tofiq <101665499+Meeran-Tofiq@users.noreply.github.com> --- apps/api/src/workspace/workspace.e2e.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/api/src/workspace/workspace.e2e.spec.ts b/apps/api/src/workspace/workspace.e2e.spec.ts index ce019d1b..a9ff2154 100644 --- a/apps/api/src/workspace/workspace.e2e.spec.ts +++ b/apps/api/src/workspace/workspace.e2e.spec.ts @@ -529,6 +529,13 @@ describe('Workspace Controller Tests', () => { expect(body.icon).toEqual(workspace1.icon) expect(body.workspaceRoles).toBeInstanceOf(Array) expect(body.projects).toBeInstanceOf(Array) + + const exampleWorkspaceRole = body.workspaceRoles[0] + expect(exampleWorkspaceRole).toHaveProperty('name') + expect(exampleWorkspaceRole).toHaveProperty('description') + expect(exampleWorkspaceRole).toHaveProperty('hasAdminAuthority') + expect(exampleWorkspaceRole).toHaveProperty('authorities') + expect(exampleWorkspaceRole).toHaveProperty('colorCode') }) })