Merge pull request #270 from SyncrowIOT/SP-1229-be-return-community-id-with-each-space-in-the-user-management

This commit is contained in:
faris Aljohari
2025-02-26 16:25:49 +03:00
committed by GitHub

View File

@ -94,7 +94,7 @@ export class ProjectUserService {
'invitedBy',
'isEnabled',
],
relations: ['roleType', 'spaces.space'],
relations: ['roleType', 'spaces.space', 'spaces.space.community'],
});
if (!user) {
@ -114,7 +114,14 @@ export class ProjectUserService {
roleType: user.roleType.type,
createdDate,
createdTime,
spaces: user.spaces.map((space) => space.space),
spaces: user.spaces.map(({ space }) => {
const { community, ...spaceWithoutCommunity } = space;
return {
...spaceWithoutCommunity,
communityUuid: community.uuid,
communityName: community.name,
};
}),
},
statusCode: HttpStatus.OK,
});