Skip to content

Commit 33fd9ae

Browse files
committed
Return user id in response
1 parent ef0e1ae commit 33fd9ae

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

backend/gateway-service/src/modules/user/dto/user-response.dto.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Exclude, Expose } from 'class-transformer';
1+
import { Exclude } from 'class-transformer';
22

33
export class UsersResponseDto {
44
@Exclude()
@@ -10,6 +10,6 @@ export class UsersResponseDto {
1010
@Exclude()
1111
socialId: string;
1212

13-
@Exclude()
14-
_id: string;
13+
// @Exclude()
14+
// _id: string;
1515
}

backend/gateway-service/src/modules/user/user.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export class UserController {
4343
const user = await firstValueFrom(
4444
this.userClient.send({ cmd: 'get-user-by-id' }, userId),
4545
);
46-
return plainToInstance(UsersResponseDto, user);
46+
const { _id, ...userDetails } = user;
47+
return plainToInstance(UsersResponseDto, { id: user._id, ...userDetails });
4748
}
4849

4950
@Patch('profile')

0 commit comments

Comments
 (0)