chaynHQ / bloom-backend

Code for the backend / API of the Bloom service
https://bloom.chayn.co/
MIT License
17 stars 29 forks source link

Fix update user id ref #505

Closed annarhughes closed 2 months ago

annarhughes commented 2 months ago

What changes did you make?

Fixes use of user.id in GET user/me The user.id was invalid as userDto type would require user.user.id. Updated req['user']; to req['userEntity']; where user.id will work as expected

Why did you make the changes?

The incorrect id ref was causing a different user to be loaded in updateUser See example log below where one userId is used in the GET, and a different userId is updated

bloom-backend   | [Nest] 39  - 07/03/2024, 12:09:13 PM     LOG [Interceptor] Completed GET "/api/v1/user/me" (IP address: ::ffff:192.168.65.1, requestUserId: 7e44cadc-a02f-435d-8667-e129a3433f46) in 2ms

bloom-backend   | [Nest] 39  - 07/03/2024, 12:09:13 PM     LOG [UserService] Object:
bloom-backend   | {
bloom-backend   |   "event": "USER_UPDATED",
bloom-backend   |   "userId": "ac39ff8f-4f40-4167-a6bb-0cf2093ba5f0",
bloom-backend   |   "fields": [
bloom-backend   |     "lastActiveAt"
bloom-backend   |   ]
bloom-backend   | }