mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
Include community details in user spaces response
This commit is contained in:
@ -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,
|
||||
});
|
||||
|
Reference in New Issue
Block a user