-
Notifications
You must be signed in to change notification settings - Fork 11.1k
feat: add avatarUrl and bio fields to /me endpoint response
#25224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add avatarUrl and bio fields to /me endpoint response
#25224
Conversation
- 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 EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- 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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
avatarUrl to /me endpoint response
avatarUrl to /me endpoint responseavatarUrl to /me endpoint response
There was a problem hiding this 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]>
avatarUrl to /me endpoint responseavatarUrl and bio fields to /me endpoint response
E2E results are ready! |
emrysal
left a comment
There was a problem hiding this 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
What does this PR do?
Adds
avatarUrlandbiofields to the/v2/meendpoint response in API v2. Previously, these fields existed in the User model but were not being returned by the endpoint.Changes:
avatarUrlandbiofields touserSchemaResponseZod schema inpackages/platform/types/me.tsMeOutputNestJS DTO inapps/api/v2/src/ee/me/outputs/me.output.tswith proper OpenAPI decorators/v2/meresponsesas anytype 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.jsonfile was not regenerated in this PR due to environment variable requirements foryarn 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)
How should this be tested?
Manual testing (IMPORTANT - please verify):
GET /v2/meendpoint with a valid API key or access tokenavatarUrlandbiofieldsnull(not missing from response)Automated tests:
apps/api/v2/src/ee/me/me.controller.e2e-spec.tsto verify both fields are present in responsesTZ=UTC yarn testto verify all tests passExpected 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:
/v2/meand confirm bothavatarUrlandbioappear in the responseUserResponsetype includes both fields)null(not missing)Note: The lint warning fixes (removing
as anyassertions on lines 156 and 162 of the test file) were necessary to pass pre-commit hooks but are unrelated to the main feature change.