Skip to content

feat: implement user profile endpoints (GET & PATCH /users/me)ย #111

Description

@Josue19-08

๐Ÿ”– Title

Implement user profile endpoints โ€” GET and PATCH /users/me


๐Ÿ“„ Description

Phase 2 of the roadmap (API-04 and API-05) is still pending. The `/auth/register` endpoint creates the user profile but there are no endpoints to retrieve or update it. This blocks the frontend from displaying or editing user data after login.


โœ… Tasks to complete

  • Create `UsersController` with `GET /users/me` endpoint (protected by `JwtAuthGuard`)
  • Create `UsersService.getProfile(userId)` that queries the `users` table via `UsersRepository`
  • Create `UpdateProfileDto` with optional fields: `displayName`, `username`, `profileImageUrl`
  • Implement `PATCH /users/me` with multipart support for profile image upload (reuse pattern from `/auth/register`)
  • Add validation: username uniqueness check on update
  • Add unit tests for `UsersService` and `UsersController`
  • Register module and update Swagger documentation

๐Ÿ“š Documentation/context for AI

(This link never should removed)
https://github.com/TrustUp-app/TrustUp-API/tree/main/docs


๐Ÿ—’๏ธ Additional notes

  • Follow the controller/service/DTO patterns documented in `docs/development/`
  • `@CurrentUser()` decorator is available to extract authenticated user ID from JWT
  • Profile image upload should follow the same Fastify multipart pattern used in `AuthController.register()`
  • Username changes must check uniqueness against existing users (excluding current user)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions