Skip to content

Include social profile fields in admin user detail lookup#62

Merged
cdsaidev merged 1 commit into
mainfrom
fix/admin-user-detail-missing-socials
Jul 5, 2026
Merged

Include social profile fields in admin user detail lookup#62
cdsaidev merged 1 commit into
mainfrom
fix/admin-user-detail-missing-socials

Conversation

@engdotme

@engdotme engdotme commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The admin user detail endpoint (UsersService.getById) was returning null for all social profile fields (LinkedIn, Twitter, Facebook, GitHub, portfolio, Telegram, WhatsApp), even when the user had submitted an application containing them.
  • toUserDto already accepts an optional socials argument sourced from the user's Application record, but getById wasn't fetching or passing it — so the admin detail view silently dropped this data.
  • Fix: fetch the user and their application's social fields in parallel (Promise.all), and pass the application data into toUserDto so the detail view is populated correctly. Falls back to null per field when the user has no application.

Changes

  • backend/src/modules/users/users.service.ts: getById now also queries application.findUnique (selecting only the social fields) and passes the result to toUserDto
  • backend/test/unit/modules/users/users.service.spec.ts: added tests covering (1) social fields populated from the application record, and (2) fields default to null when no application exists

Test plan

  • Unit tests added/updated in users.service.spec.ts
  • Manually verify: viewing a user's detail page in the admin panel for a user who submitted an application shows their social links

@engdotme engdotme requested a review from cdsaidev July 5, 2026 16:37
@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
forgeng-frontend Ready Ready Preview, Comment Jul 5, 2026 4:38pm

@engdotme engdotme marked this pull request as ready for review July 5, 2026 16:38
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Backend coverage

Backend coverage

Lines Statements Branches Functions
Coverage: 72%
71.41% (1434/2008) 64.93% (852/1312) 73.78% (273/370)

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Frontend coverage

Frontend coverage

Lines Statements Branches Functions
Coverage: 31%
31.29% (819/2617) 24.61% (400/1625) 25.56% (192/751)

@cdsaidev cdsaidev merged commit 0e0a32f into main Jul 5, 2026
4 checks passed
@cdsaidev cdsaidev deleted the fix/admin-user-detail-missing-socials branch July 5, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants