From ec26c0b7975134c5402c30cb7989fd485a72d611 Mon Sep 17 00:00:00 2001 From: Meeran Tofiq <101665499+Meeran-Tofiq@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:39:10 +0300 Subject: [PATCH] feat: Remove project IDs from workspace role export data and update tests (#448) Signed-off-by: Meeran Tofiq <101665499+Meeran-Tofiq@users.noreply.github.com> --- apps/api/src/workspace/service/workspace.service.ts | 7 +------ apps/api/src/workspace/workspace.e2e.spec.ts | 7 +++++++ 2 files changed, 8 insertions(+), 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 } }) 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') }) })