Skip to content

Conversation

@Ryukemeister
Copy link
Contributor

@Ryukemeister Ryukemeister commented Nov 17, 2025

What does this PR do?

Adds avatarUrl and bio fields to the /v2/me endpoint response in API v2. Previously, these fields existed in the User model but were not being returned by the endpoint.

Changes:

  • Added avatarUrl and bio fields to userSchemaResponse Zod schema in packages/platform/types/me.ts
  • Added both fields to MeOutput NestJS DTO in apps/api/v2/src/ee/me/outputs/me.output.ts with proper OpenAPI decorators
  • Updated e2e tests to verify both fields are returned in GET and PATCH /v2/me responses
  • Fixed pre-existing lint warnings by removing as any type assertions in test file (required to pass pre-commit hooks)

Both fields are nullable to match the User model in the Prisma schema - users without avatars or bios will receive null.

Note on OpenAPI documentation: The docs/api-reference/v2/openapi.json file was not regenerated in this PR due to environment variable requirements for yarn generate-swagger. The DTOs have been updated with proper decorators, so the docs will reflect these changes when regenerated in a proper environment.


Link to Devin run: https://app.devin.ai/sessions/dd3d701e731d4568a030d085f944c875
Requested by: [email protected] (@Ryukemeister)
Slack thread: https://calendso.slack.com/archives/C08LT9BLEET/p1763394906254669

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox. N/A - This is an additive API change. The DTOs have been updated with OpenAPI decorators so docs will be correct when regenerated.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Manual testing (IMPORTANT - please verify):

  1. Make an authenticated API call to GET /v2/me endpoint with a valid API key or access token
  2. Verify that the response includes both avatarUrl and bio fields
  3. Test with a user that has an avatar and bio set - verify the values are returned correctly
  4. Test with a user without an avatar or bio - verify the fields are null (not missing from response)

Automated tests:

  • E2E tests have been updated in apps/api/v2/src/ee/me/me.controller.e2e-spec.ts to verify both fields are present in responses
  • Run TZ=UTC yarn test to verify all tests pass

Expected output:

{
  "status": "success",
  "data": {
    "id": 123516,
    "email": "[email protected]",
    "name": "User Name",
    "avatarUrl": "https://example.com/avatar.png",  // or null
    "bio": "User bio text",  // or null
    "timeFormat": 12,
    "defaultScheduleId": 126344,
    "weekStart": "Sunday",
    "timeZone": "Europe/London",
    "username": "username",
    "organizationId": 12737,
    "organization": {
      "isPlatform": false,
      "id": 12737
    }
  }
}

Human Review Checklist

Critical items to verify:

  • Make a real API call to /v2/me and confirm both avatarUrl and bio appear in the response
  • Verify the TypeScript types are correctly updated (check that UserResponse type includes both fields)
  • Test with a user that has an avatar and bio set - verify the values are correct
  • Test with a user that doesn't have an avatar or bio - verify the fields are null (not missing)
  • Consider whether OpenAPI docs should be regenerated as part of this PR or in a follow-up
  • Verify this change doesn't break any existing API consumers (additive change should be safe)

Note: The lint warning fixes (removing as any assertions on lines 156 and 162 of the test file) were necessary to pass pre-commit hooks but are unrelated to the main feature change.

- Add avatarUrl field to userSchemaResponse schema in packages/platform/types/me.ts
- Update e2e tests to verify avatarUrl is returned in GET and PATCH /v2/me responses
- Field is nullable to match User model in Prisma schema
- Fix pre-existing lint warnings by removing 'as any' type assertions in test file

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Nov 17, 2025
- Add avatarUrl field to MeOutput class in apps/api/v2/src/ee/me/outputs/me.output.ts
- Field is nullable to match the Zod schema and Prisma model
- This ensures OpenAPI documentation will include avatarUrl when regenerated

Co-Authored-By: [email protected] <[email protected]>
@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Nov 19, 2025 1:15pm
cal-eu Ignored Ignored Nov 19, 2025 1:15pm

@Ryukemeister Ryukemeister marked this pull request as ready for review November 17, 2025 16:54
@Ryukemeister Ryukemeister requested review from a team as code owners November 17, 2025 16:54
@Ryukemeister Ryukemeister changed the title feat: add avatarUrl to /v2/me endpoint response feat: add avatarUrl to /me endpoint response Nov 17, 2025
@Ryukemeister Ryukemeister changed the title feat: add avatarUrl to /me endpoint response feat: add avatarUrl to /me endpoint response Nov 17, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

- Add bio field to userSchemaResponse Zod schema in packages/platform/types/me.ts
- Add bio field to MeOutput NestJS DTO in apps/api/v2/src/ee/me/outputs/me.output.ts
- Update e2e tests to verify bio is returned in both GET and PATCH responses
- Field is nullable to match the User model in Prisma schema

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration devin-ai-integration bot changed the title feat: add avatarUrl to /me endpoint response feat: add avatarUrl and bio fields to /v2/me endpoint response Nov 17, 2025
@Ryukemeister Ryukemeister changed the title feat: add avatarUrl and bio fields to /v2/me endpoint response feat: add avatarUrl and bio fields to /me endpoint response Nov 17, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

E2E results are ready!

@Ryukemeister Ryukemeister enabled auto-merge (squash) November 19, 2025 13:03
Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@Ryukemeister Ryukemeister merged commit 1dcd54a into main Nov 19, 2025
62 of 67 checks passed
@Ryukemeister Ryukemeister deleted the devin/add-avatar-url-to-me-endpoint-1763395313 branch November 19, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only platform Anything related to our platform plan ready-for-e2e size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants