Skip to content

Commit

Permalink
fix(API): Replace projectId with name and slug in workspace-role resp…
Browse files Browse the repository at this point in the history
…onse
  • Loading branch information
Nil2000 authored and rajdip-b committed Sep 15, 2024
1 parent 27f4309 commit b563185
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
28 changes: 25 additions & 3 deletions apps/api/src/workspace-role/service/workspace-role.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ export class WorkspaceRoleService {
include: {
projects: {
select: {
projectId: true
projectId: true,
project: {
select: {
slug: true,
name: true
}
}
}
}
}
Expand Down Expand Up @@ -228,7 +234,13 @@ export class WorkspaceRoleService {
include: {
projects: {
select: {
projectId: true
projectId: true,
project: {
select: {
slug: true,
name: true
}
}
}
}
}
Expand Down Expand Up @@ -443,7 +455,17 @@ export class WorkspaceRoleService {
slug: workspaceRoleSlug
},
include: {
projects: true
projects: {
select: {
projectId: true,
project: {
select: {
slug: true,
name: true
}
}
}
}
}
})) as WorkspaceRoleWithProjects

Expand Down
16 changes: 12 additions & 4 deletions apps/api/src/workspace-role/workspace-role.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,14 @@ describe('Workspace Role Controller Tests', () => {
updatedAt: expect.any(String),
projects: expect.arrayContaining([
{
projectId: projects[0].id
projectId: projects[0].id,
slug: projects[0].slug,
name: projects[0].name
},
{
projectId: projects[1].id
projectId: projects[1].id,
slug: projects[1].slug,
name: projects[1].name
}
])
})
Expand Down Expand Up @@ -654,10 +658,14 @@ describe('Workspace Role Controller Tests', () => {
hasAdminAuthority: true,
projects: expect.arrayContaining([
{
projectId: projects[0].id
projectId: projects[0].id,
slug: projects[0].slug,
name: projects[0].name
},
{
projectId: projects[1].id
projectId: projects[1].id,
slug: projects[1].slug,
name: projects[1].name
}
])
})
Expand Down

0 comments on commit b563185

Please sign in to comment.